Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Populates options on a schema level #1325

rogovdm opened this Issue Feb 1, 2013 · 1 comment


None yet
2 participants

rogovdm commented Feb 1, 2013

Is it possible to set fields that should be included in the populated field on a schema level?

Something like:

var schema = new Schema({
                            _idUser:       {
                                type:    Schema.Types.ObjectId,
                                onPopulate: ["-_name, "-nick"],
                                ref: "user"

It would be very nice.


aheckmann commented Feb 2, 2013

Not on the population level but on the "user" schema level we do, which works the same way but affects every query of the model: http://mongoosejs.com/docs/api.html#schematype_SchemaType-select

@aheckmann aheckmann closed this Feb 19, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment