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
Hi, Is it currently possible to populate across multiple levels via a rest URL get request?
For example, populating the friends array with user data:
const userSchema = new Schema({ name: { type: String, default: '', required: true }, friends: [ { friendId: { type: String, ref: 'users' }, ...
If not, any advice on how this could be achieved?
The text was updated successfully, but these errors were encountered:
Assuming the users schema/model is registered, this works for me.
users
/service-name/?$populate[]=friends.friendId
I'll add that I've only done this when the field to populate is {type: Schema.Types.ObjectId}, so I'm not sure if it'll work with type String or not.
{type: Schema.Types.ObjectId},
String
Sorry, something went wrong.
Ah ha, I didn't realise you could do square brackets deal. Thanks so much @adamh114
No branches or pull requests
Hi,
Is it currently possible to populate across multiple levels via a rest URL get request?
For example, populating the friends array with user data:
If not, any advice on how this could be achieved?
The text was updated successfully, but these errors were encountered: