Skip to content
New issue

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

Optional Prepopulating Through url param #581

Open
AkramEld opened this issue Apr 15, 2020 · 0 comments
Open

Optional Prepopulating Through url param #581

AkramEld opened this issue Apr 15, 2020 · 0 comments

Comments

@AkramEld
Copy link

Lets say you have a Teams Model with:
name: { type: String, required: true }, playerIds: { type: Array, required: true },

and you use "populate" to prepopulate with the players objects like so
const userRolesSchema = { include: { service: 'api/players', nameAs: 'players', parentField: 'playerIds', childField: '_id', asArray: true } }

Is there a way to pass a parameter to the teams api to not prepopulate it sometimes, lets say "/api/teams?players=no"

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant