-
- Notifications
You must be signed in to change notification settings - Fork 7.2k
Open
Description
I have a database like:
{ posts: [ { id: 1, title: 'post 1', userId: 1, tagIds: [1,2,3] }, { id: 2, title: 'post 2', userId: 1, tagIds: [3,5] }, { id: 3, title: 'post 3', userId: 5, tagIds: [4] }, < ... > ], users: < ... >, tags: [ { id: 1, title: 'tag 1' }, { id: 2, title: 'tag 2' }, { id: 3, title: 'tag 3' }, { id: 4, title: 'tag 4' }, { id: 5, title: 'tag 5' }, < ... > ] } I need to query posts with their tags like /posts?tags=1 or /tags/2/posts but it only return posts that have one tag (I need) not with other tags. (it works for /posts?userId=1 and /users/1/posts)
maybe something like $in and $notIn is good for that.
I also want to use _embed or _expand in my queries for posts but it doesn't work for tags (it works for user and userId)
maybeuse _include for it, like: this repo
tzaban, sagar-gavhane, ajaxsys, aadrian, maxsnz and 4 more
Metadata
Metadata
Assignees
Labels
No labels