We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It's pretty reasonable, especially when using population inside of the server, to allow populating (ie. joining) directly related tables.
Let's take an example of getting all the blog posts for a user but you also want the comments.
When a GET request is sent to /posts, the unencoded query string syntax should probably be:
GET
/posts
{ userId: 1, $populate: ['comments'] }
Which would result in a find on the posts table with a join on comments where posts.id = comments.postId.
find
posts.id = comments.postId
Soliciting feedback, as you can also accomplish this with hooks, so maybe it should be left up to the user to implement.
The text was updated successfully, but these errors were encountered:
I think we can do this now with the populate hook so I'm going to close this.
Sorry, something went wrong.
Yeah you can. I was going to write my own using mongooses populate function but all I ended up having to do was:
populate
userService.after(hooks.populate('posts', { service: '/posts' }))
Works like a charm.
No branches or pull requests
It's pretty reasonable, especially when using population inside of the server, to allow populating (ie. joining) directly related tables.
Let's take an example of getting all the blog posts for a user but you also want the comments.
When a
GET
request is sent to/posts
, the unencoded query string syntax should probably be:Which would result in a
find
on the posts table with a join on comments whereposts.id = comments.postId
.Soliciting feedback, as you can also accomplish this with hooks, so maybe it should be left up to the user to implement.
The text was updated successfully, but these errors were encountered: