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

Many to many? #34

Open
jayarjo opened this issue Oct 14, 2019 · 1 comment
Open

Many to many? #34

jayarjo opened this issue Oct 14, 2019 · 1 comment

Comments

@jayarjo
Copy link

jayarjo commented Oct 14, 2019

Is many to many possible with this? What the syntax would be?

@dfahlander
Copy link
Owner

There's currently no syntactic support for it in this addon.
Been thinking about syntaxes as the following:

db.version(1).stores({
    genres: 'id, name',
    bands: 'id, name, *genreIds -> genres.id',
    albums: 'id, name, bandId -> bands.id, year'
});

To load, use db.bands.with({genres: "genreIds"})

If so, it could utilize multiEntry index for this. Pull requests are welcome!
/D

# 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

2 participants