Skip to content

Many to Many support #805

@HKhademian

Description

@HKhademian

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions