question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Queries across backlinks (linking objects)

See original GitHub issue

Goals

Create query across backlink just like you would do with regular links.

Expected Results

Successfully retrieve results.

Actual Results

Property ‘onSale’ is not a link in object of type ‘Combination’

Steps to Reproduce

class Product {};
  Product.schema = {
    name: 'Product',
    primaryKey:'productId',
    properties: {
        productId:'int',
        product:'string'
        combinations: {type: 'linkingObjects', objectType: 'Combination', property: 'products'}
    }
};

class Combination {};
Combination.schema = {
    name: 'Combination',
    properties: {
        onSale: {type: 'string'},
        products: {type: 'list',objectType:'Product'},
    }
};

and

let queryFilter = 'combinations.onSale = "yes" AND productId = 1';
let data = realm.objects('Product').filtered(queryFilter);

Version of Realm and Tooling

  • Realm JS SDK Version: the latest at this time
  • Node or React Native: .
  • Client OS & Version: .
  • Which debugger for React Native: None

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:5
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
knethcommented, Mar 13, 2018

Closing as #1660 has been merged. It will be released soon.

0reactions
ironagecommented, May 23, 2018

@sellmeadog yes, I’d expect it to be working since 2.3.4. Are you able to share your query and the schemas of the linked classes if not your actual models, a minimal example that can reproduce the behaviour you see?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Realm backlinks, queries to linking objects, and changes in ...
Realm backlinks, queries to linking objects, and changes in schema design. In Realm Android 3.4.0-SNAPSHOT, support for queries across backlinks got merged, ...
Read more >
Tutorial: Query language
Links are properties which are an object type, for example Car.owner is a forward link. You can query through a forward link chain...
Read more >
21 Link Builders Share Advanced Link Building Queries
Advanced link building queries, for the link builders who use them extensively, remain a closely guarded secret. It's easy to understand why.
Read more >
Backlinks: What They Are And How To Get Them
Backlinks are simply links from one website to another. Sometimes called “incoming links” or “inbound links,” backlinks are one of the most ...
Read more >
Manual query to search for backlinks? | SEO Forum
Gain intel on your top SERP competitors, keyword gaps, and content opportunities. ... Powerful Backlink Data for SEO. Explore our index of over...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found