Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Nested relationships #32

Open
adnathanail opened this issue Aug 23, 2018 · 3 comments
Open

Nested relationships #32

adnathanail opened this issue Aug 23, 2018 · 3 comments

Comments

@adnathanail
Copy link

Hi just wondering if you can help?

My schema looks like this:

db.version(6).stores({
      route: 'id,name',
      journey: 'id,date,route -> route.id',
      fare: 'id',
      stop: 'id,name,route -> route.id',
      time_set: 'id,stop -> stop.id',
      departure: 'id,journey -> journey.id,time_set -> time_set.id',
    });

And I am trying to make a query like this:

this._dexieService.departure
              .filter((departure): boolean => {
                return departure.journey === journey_id;
              })
              .with({
                journey: 'journey',
                time_set: 'time_set',
                time_set__stop: 'stop',
              });

But that last line in the with is obviously not working (One of a number of different syntaxes I've tried). Essentially I want to have an object inside an object inside an object, to represented the 3-level nested relationship between departures->time_sets->stops (and then also ->routes)

Just wondering if it is at all possible to have this kind of output?

@dfahlander
Copy link
Owner

Unfortunately, dexie-relationships does only work in one level relations.

@adnathanail
Copy link
Author

Ah OK thanks anyway

@justin-hackin
Copy link

Please consider loudly announcing this lack of support in your documentation. By chance, I noticed this and saved myself lot of wasted time but I'm concerned others like the poster might not.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants