This commit is contained in:
Jonasz Bigda
2023-03-25 21:51:42 +01:00
parent 0db1d5117e
commit b332e9ceb0
1044 changed files with 37502 additions and 63938 deletions

View File

@@ -67,6 +67,31 @@ Object.defineProperty(SchemaNumberOptions.prototype, 'max', opts);
Object.defineProperty(SchemaNumberOptions.prototype, 'enum', opts);
/**
* Sets default [populate options](/docs/populate.html#query-conditions).
*
* ####Example:
* const schema = new Schema({
* child: {
* type: Number,
* ref: 'Child',
* populate: { select: 'name' }
* }
* });
* const Parent = mongoose.model('Parent', schema);
*
* // Automatically adds `.select('name')`
* Parent.findOne().populate('child');
*
* @api public
* @property populate
* @memberOf SchemaNumberOptions
* @type Object
* @instance
*/
Object.defineProperty(SchemaNumberOptions.prototype, 'populate', opts);
/*!
* ignore
*/