some progress

This commit is contained in:
Jonas_Jones 2023-03-30 20:40:42 +02:00
parent aea93a5527
commit e3c15bd288
1388 changed files with 306946 additions and 68323 deletions

36
node_modules/mongoose/lib/options/PopulateOptions.js generated vendored Normal file
View file

@ -0,0 +1,36 @@
'use strict';
const clone = require('../helpers/clone');
class PopulateOptions {
constructor(obj) {
this._docs = {};
this._childDocs = [];
if (obj == null) {
return;
}
obj = clone(obj);
Object.assign(this, obj);
if (typeof obj.subPopulate === 'object') {
this.populate = obj.subPopulate;
}
if (obj.perDocumentLimit != null && obj.limit != null) {
throw new Error('Can not use `limit` and `perDocumentLimit` at the same time. Path: `' + obj.path + '`.');
}
}
}
/**
* The connection used to look up models by name. If not specified, Mongoose
* will default to using the connection associated with the model in
* `PopulateOptions#model`.
*
* @memberOf PopulateOptions
* @property {Connection} connection
* @api public
*/
module.exports = PopulateOptions;

View file

@ -0,0 +1,78 @@
'use strict';
const SchemaTypeOptions = require('./SchemaTypeOptions');
/**
* The options defined on an Array schematype.
*
* #### Example:
*
* const schema = new Schema({ tags: [String] });
* schema.path('tags').options; // SchemaArrayOptions instance
*
* @api public
* @inherits SchemaTypeOptions
* @constructor SchemaArrayOptions
*/
class SchemaArrayOptions extends SchemaTypeOptions {}
const opts = require('./propertyOptions');
/**
* If this is an array of strings, an array of allowed values for this path.
* Throws an error if this array isn't an array of strings.
*
* @api public
* @property enum
* @memberOf SchemaArrayOptions
* @type {Array}
* @instance
*/
Object.defineProperty(SchemaArrayOptions.prototype, 'enum', opts);
/**
* If set, specifies the type of this array's values. Equivalent to setting
* `type` to an array whose first element is `of`.
*
* #### Example:
*
* // `arr` is an array of numbers.
* new Schema({ arr: [Number] });
* // Equivalent way to define `arr` as an array of numbers
* new Schema({ arr: { type: Array, of: Number } });
*
* @api public
* @property of
* @memberOf SchemaArrayOptions
* @type {Function|String}
* @instance
*/
Object.defineProperty(SchemaArrayOptions.prototype, 'of', opts);
/**
* If set to `false`, will always deactivate casting non-array values to arrays.
* If set to `true`, will cast non-array values to arrays if `init` and `SchemaArray.options.castNonArrays` are also `true`
*
* #### Example:
*
* const Model = db.model('Test', new Schema({ x1: { castNonArrays: false, type: [String] } }));
* const doc = new Model({ x1: "some non-array value" });
* await doc.validate(); // Errors with "CastError"
*
* @api public
* @property castNonArrays
* @memberOf SchemaArrayOptions
* @type {Boolean}
* @instance
*/
Object.defineProperty(SchemaArrayOptions.prototype, 'castNonArrays', opts);
/*!
* ignore
*/
module.exports = SchemaArrayOptions;

View file

@ -0,0 +1,38 @@
'use strict';
const SchemaTypeOptions = require('./SchemaTypeOptions');
/**
* The options defined on a Buffer schematype.
*
* #### Example:
*
* const schema = new Schema({ bitmap: Buffer });
* schema.path('bitmap').options; // SchemaBufferOptions instance
*
* @api public
* @inherits SchemaTypeOptions
* @constructor SchemaBufferOptions
*/
class SchemaBufferOptions extends SchemaTypeOptions {}
const opts = require('./propertyOptions');
/**
* Set the default subtype for this buffer.
*
* @api public
* @property subtype
* @memberOf SchemaBufferOptions
* @type {Number}
* @instance
*/
Object.defineProperty(SchemaBufferOptions.prototype, 'subtype', opts);
/*!
* ignore
*/
module.exports = SchemaBufferOptions;

71
node_modules/mongoose/lib/options/SchemaDateOptions.js generated vendored Normal file
View file

@ -0,0 +1,71 @@
'use strict';
const SchemaTypeOptions = require('./SchemaTypeOptions');
/**
* The options defined on a Date schematype.
*
* #### Example:
*
* const schema = new Schema({ startedAt: Date });
* schema.path('startedAt').options; // SchemaDateOptions instance
*
* @api public
* @inherits SchemaTypeOptions
* @constructor SchemaDateOptions
*/
class SchemaDateOptions extends SchemaTypeOptions {}
const opts = require('./propertyOptions');
/**
* If set, Mongoose adds a validator that checks that this path is after the
* given `min`.
*
* @api public
* @property min
* @memberOf SchemaDateOptions
* @type {Date}
* @instance
*/
Object.defineProperty(SchemaDateOptions.prototype, 'min', opts);
/**
* If set, Mongoose adds a validator that checks that this path is before the
* given `max`.
*
* @api public
* @property max
* @memberOf SchemaDateOptions
* @type {Date}
* @instance
*/
Object.defineProperty(SchemaDateOptions.prototype, 'max', opts);
/**
* If set, Mongoose creates a TTL index on this path.
*
* mongo TTL index `expireAfterSeconds` value will take 'expires' value expressed in seconds.
*
* #### Example:
*
* const schema = new Schema({ "expireAt": { type: Date, expires: 11 } });
* // if 'expireAt' is set, then document expires at expireAt + 11 seconds
*
* @api public
* @property expires
* @memberOf SchemaDateOptions
* @type {Date}
* @instance
*/
Object.defineProperty(SchemaDateOptions.prototype, 'expires', opts);
/*!
* ignore
*/
module.exports = SchemaDateOptions;

View file

@ -0,0 +1,68 @@
'use strict';
const SchemaTypeOptions = require('./SchemaTypeOptions');
/**
* The options defined on an Document Array schematype.
*
* #### Example:
*
* const schema = new Schema({ users: [{ name: string }] });
* schema.path('users').options; // SchemaDocumentArrayOptions instance
*
* @api public
* @inherits SchemaTypeOptions
* @constructor SchemaDocumentOptions
*/
class SchemaDocumentArrayOptions extends SchemaTypeOptions {}
const opts = require('./propertyOptions');
/**
* If `true`, Mongoose will skip building any indexes defined in this array's schema.
* If not set, Mongoose will build all indexes defined in this array's schema.
*
* #### Example:
*
* const childSchema = Schema({ name: { type: String, index: true } });
* // If `excludeIndexes` is `true`, Mongoose will skip building an index
* // on `arr.name`. Otherwise, Mongoose will build an index on `arr.name`.
* const parentSchema = Schema({
* arr: { type: [childSchema], excludeIndexes: true }
* });
*
* @api public
* @property excludeIndexes
* @memberOf SchemaDocumentArrayOptions
* @type {Array}
* @instance
*/
Object.defineProperty(SchemaDocumentArrayOptions.prototype, 'excludeIndexes', opts);
/**
* If set, overwrites the child schema's `_id` option.
*
* #### Example:
*
* const childSchema = Schema({ name: String });
* const parentSchema = Schema({
* child: { type: childSchema, _id: false }
* });
* parentSchema.path('child').schema.options._id; // false
*
* @api public
* @property _id
* @memberOf SchemaDocumentArrayOptions
* @type {Array}
* @instance
*/
Object.defineProperty(SchemaDocumentArrayOptions.prototype, '_id', opts);
/*!
* ignore
*/
module.exports = SchemaDocumentArrayOptions;

43
node_modules/mongoose/lib/options/SchemaMapOptions.js generated vendored Normal file
View file

@ -0,0 +1,43 @@
'use strict';
const SchemaTypeOptions = require('./SchemaTypeOptions');
/**
* The options defined on a Map schematype.
*
* #### Example:
*
* const schema = new Schema({ socialMediaHandles: { type: Map, of: String } });
* schema.path('socialMediaHandles').options; // SchemaMapOptions instance
*
* @api public
* @inherits SchemaTypeOptions
* @constructor SchemaMapOptions
*/
class SchemaMapOptions extends SchemaTypeOptions {}
const opts = require('./propertyOptions');
/**
* If set, specifies the type of this map's values. Mongoose will cast
* this map's values to the given type.
*
* If not set, Mongoose will not cast the map's values.
*
* #### Example:
*
* // Mongoose will cast `socialMediaHandles` values to strings
* const schema = new Schema({ socialMediaHandles: { type: Map, of: String } });
* schema.path('socialMediaHandles').options.of; // String
*
* @api public
* @property of
* @memberOf SchemaMapOptions
* @type {Function|string}
* @instance
*/
Object.defineProperty(SchemaMapOptions.prototype, 'of', opts);
module.exports = SchemaMapOptions;

View file

@ -0,0 +1,101 @@
'use strict';
const SchemaTypeOptions = require('./SchemaTypeOptions');
/**
* The options defined on a Number schematype.
*
* #### Example:
*
* const schema = new Schema({ count: Number });
* schema.path('count').options; // SchemaNumberOptions instance
*
* @api public
* @inherits SchemaTypeOptions
* @constructor SchemaNumberOptions
*/
class SchemaNumberOptions extends SchemaTypeOptions {}
const opts = require('./propertyOptions');
/**
* If set, Mongoose adds a validator that checks that this path is at least the
* given `min`.
*
* @api public
* @property min
* @memberOf SchemaNumberOptions
* @type {Number}
* @instance
*/
Object.defineProperty(SchemaNumberOptions.prototype, 'min', opts);
/**
* If set, Mongoose adds a validator that checks that this path is less than the
* given `max`.
*
* @api public
* @property max
* @memberOf SchemaNumberOptions
* @type {Number}
* @instance
*/
Object.defineProperty(SchemaNumberOptions.prototype, 'max', opts);
/**
* If set, Mongoose adds a validator that checks that this path is strictly
* equal to one of the given values.
*
* #### Example:
*
* const schema = new Schema({
* favoritePrime: {
* type: Number,
* enum: [3, 5, 7]
* }
* });
* schema.path('favoritePrime').options.enum; // [3, 5, 7]
*
* @api public
* @property enum
* @memberOf SchemaNumberOptions
* @type {Array}
* @instance
*/
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
*/
module.exports = SchemaNumberOptions;

View file

@ -0,0 +1,64 @@
'use strict';
const SchemaTypeOptions = require('./SchemaTypeOptions');
/**
* The options defined on an ObjectId schematype.
*
* #### Example:
*
* const schema = new Schema({ testId: mongoose.ObjectId });
* schema.path('testId').options; // SchemaObjectIdOptions instance
*
* @api public
* @inherits SchemaTypeOptions
* @constructor SchemaObjectIdOptions
*/
class SchemaObjectIdOptions extends SchemaTypeOptions {}
const opts = require('./propertyOptions');
/**
* If truthy, uses Mongoose's default built-in ObjectId path.
*
* @api public
* @property auto
* @memberOf SchemaObjectIdOptions
* @type {Boolean}
* @instance
*/
Object.defineProperty(SchemaObjectIdOptions.prototype, 'auto', opts);
/**
* Sets default [populate options](/docs/populate.html#query-conditions).
*
* #### Example:
*
* const schema = new Schema({
* child: {
* type: 'ObjectId',
* ref: 'Child',
* populate: { select: 'name' }
* }
* });
* const Parent = mongoose.model('Parent', schema);
*
* // Automatically adds `.select('name')`
* Parent.findOne().populate('child');
*
* @api public
* @property populate
* @memberOf SchemaObjectIdOptions
* @type {Object}
* @instance
*/
Object.defineProperty(SchemaObjectIdOptions.prototype, 'populate', opts);
/*!
* ignore
*/
module.exports = SchemaObjectIdOptions;

View file

@ -0,0 +1,138 @@
'use strict';
const SchemaTypeOptions = require('./SchemaTypeOptions');
/**
* The options defined on a string schematype.
*
* #### Example:
*
* const schema = new Schema({ name: String });
* schema.path('name').options; // SchemaStringOptions instance
*
* @api public
* @inherits SchemaTypeOptions
* @constructor SchemaStringOptions
*/
class SchemaStringOptions extends SchemaTypeOptions {}
const opts = require('./propertyOptions');
/**
* Array of allowed values for this path
*
* @api public
* @property enum
* @memberOf SchemaStringOptions
* @type {Array}
* @instance
*/
Object.defineProperty(SchemaStringOptions.prototype, 'enum', opts);
/**
* Attach a validator that succeeds if the data string matches the given regular
* expression, and fails otherwise.
*
* @api public
* @property match
* @memberOf SchemaStringOptions
* @type {RegExp}
* @instance
*/
Object.defineProperty(SchemaStringOptions.prototype, 'match', opts);
/**
* If truthy, Mongoose will add a custom setter that lowercases this string
* using JavaScript's built-in `String#toLowerCase()`.
*
* @api public
* @property lowercase
* @memberOf SchemaStringOptions
* @type {Boolean}
* @instance
*/
Object.defineProperty(SchemaStringOptions.prototype, 'lowercase', opts);
/**
* If truthy, Mongoose will add a custom setter that removes leading and trailing
* whitespace using [JavaScript's built-in `String#trim()`](https://masteringjs.io/tutorials/fundamentals/trim-string).
*
* @api public
* @property trim
* @memberOf SchemaStringOptions
* @type {Boolean}
* @instance
*/
Object.defineProperty(SchemaStringOptions.prototype, 'trim', opts);
/**
* If truthy, Mongoose will add a custom setter that uppercases this string
* using JavaScript's built-in [`String#toUpperCase()`](https://masteringjs.io/tutorials/fundamentals/uppercase).
*
* @api public
* @property uppercase
* @memberOf SchemaStringOptions
* @type {Boolean}
* @instance
*/
Object.defineProperty(SchemaStringOptions.prototype, 'uppercase', opts);
/**
* If set, Mongoose will add a custom validator that ensures the given
* string's `length` is at least the given number.
*
* Mongoose supports two different spellings for this option: `minLength` and `minlength`.
* `minLength` is the recommended way to specify this option, but Mongoose also supports
* `minlength` (lowercase "l").
*
* @api public
* @property minLength
* @memberOf SchemaStringOptions
* @type {Number}
* @instance
*/
Object.defineProperty(SchemaStringOptions.prototype, 'minLength', opts);
Object.defineProperty(SchemaStringOptions.prototype, 'minlength', opts);
/**
* If set, Mongoose will add a custom validator that ensures the given
* string's `length` is at most the given number.
*
* Mongoose supports two different spellings for this option: `maxLength` and `maxlength`.
* `maxLength` is the recommended way to specify this option, but Mongoose also supports
* `maxlength` (lowercase "l").
*
* @api public
* @property maxLength
* @memberOf SchemaStringOptions
* @type {Number}
* @instance
*/
Object.defineProperty(SchemaStringOptions.prototype, 'maxLength', opts);
Object.defineProperty(SchemaStringOptions.prototype, 'maxlength', opts);
/**
* Sets default [populate options](/docs/populate.html#query-conditions).
*
* @api public
* @property populate
* @memberOf SchemaStringOptions
* @type {Object}
* @instance
*/
Object.defineProperty(SchemaStringOptions.prototype, 'populate', opts);
/*!
* ignore
*/
module.exports = SchemaStringOptions;

View file

@ -0,0 +1,42 @@
'use strict';
const SchemaTypeOptions = require('./SchemaTypeOptions');
/**
* The options defined on a single nested schematype.
*
* #### Example:
*
* const schema = Schema({ child: Schema({ name: String }) });
* schema.path('child').options; // SchemaSubdocumentOptions instance
*
* @api public
* @inherits SchemaTypeOptions
* @constructor SchemaSubdocumentOptions
*/
class SchemaSubdocumentOptions extends SchemaTypeOptions {}
const opts = require('./propertyOptions');
/**
* If set, overwrites the child schema's `_id` option.
*
* #### Example:
*
* const childSchema = Schema({ name: String });
* const parentSchema = Schema({
* child: { type: childSchema, _id: false }
* });
* parentSchema.path('child').schema.options._id; // false
*
* @api public
* @property of
* @memberOf SchemaSubdocumentOptions
* @type {Function|string}
* @instance
*/
Object.defineProperty(SchemaSubdocumentOptions.prototype, '_id', opts);
module.exports = SchemaSubdocumentOptions;

244
node_modules/mongoose/lib/options/SchemaTypeOptions.js generated vendored Normal file
View file

@ -0,0 +1,244 @@
'use strict';
const clone = require('../helpers/clone');
/**
* The options defined on a schematype.
*
* #### Example:
*
* const schema = new Schema({ name: String });
* schema.path('name').options instanceof mongoose.SchemaTypeOptions; // true
*
* @api public
* @constructor SchemaTypeOptions
*/
class SchemaTypeOptions {
constructor(obj) {
if (obj == null) {
return this;
}
Object.assign(this, clone(obj));
}
}
const opts = require('./propertyOptions');
/**
* The type to cast this path to.
*
* @api public
* @property type
* @memberOf SchemaTypeOptions
* @type {Function|String|Object}
* @instance
*/
Object.defineProperty(SchemaTypeOptions.prototype, 'type', opts);
/**
* Function or object describing how to validate this schematype.
*
* @api public
* @property validate
* @memberOf SchemaTypeOptions
* @type {Function|Object}
* @instance
*/
Object.defineProperty(SchemaTypeOptions.prototype, 'validate', opts);
/**
* Allows overriding casting logic for this individual path. If a string, the
* given string overwrites Mongoose's default cast error message.
*
* #### Example:
*
* const schema = new Schema({
* num: {
* type: Number,
* cast: '{VALUE} is not a valid number'
* }
* });
*
* // Throws 'CastError: "bad" is not a valid number'
* schema.path('num').cast('bad');
*
* const Model = mongoose.model('Test', schema);
* const doc = new Model({ num: 'fail' });
* const err = doc.validateSync();
*
* err.errors['num']; // 'CastError: "fail" is not a valid number'
*
* @api public
* @property cast
* @memberOf SchemaTypeOptions
* @type {String}
* @instance
*/
Object.defineProperty(SchemaTypeOptions.prototype, 'cast', opts);
/**
* If true, attach a required validator to this path, which ensures this path
* cannot be set to a nullish value. If a function, Mongoose calls the
* function and only checks for nullish values if the function returns a truthy value.
*
* @api public
* @property required
* @memberOf SchemaTypeOptions
* @type {Function|Boolean}
* @instance
*/
Object.defineProperty(SchemaTypeOptions.prototype, 'required', opts);
/**
* The default value for this path. If a function, Mongoose executes the function
* and uses the return value as the default.
*
* @api public
* @property default
* @memberOf SchemaTypeOptions
* @type {Function|Any}
* @instance
*/
Object.defineProperty(SchemaTypeOptions.prototype, 'default', opts);
/**
* The model that `populate()` should use if populating this path.
*
* @api public
* @property ref
* @memberOf SchemaTypeOptions
* @type {Function|String}
* @instance
*/
Object.defineProperty(SchemaTypeOptions.prototype, 'ref', opts);
/**
* The path in the document that `populate()` should use to find the model
* to use.
*
* @api public
* @property ref
* @memberOf SchemaTypeOptions
* @type {Function|String}
* @instance
*/
Object.defineProperty(SchemaTypeOptions.prototype, 'refPath', opts);
/**
* Whether to include or exclude this path by default when loading documents
* using `find()`, `findOne()`, etc.
*
* @api public
* @property select
* @memberOf SchemaTypeOptions
* @type {Boolean|Number}
* @instance
*/
Object.defineProperty(SchemaTypeOptions.prototype, 'select', opts);
/**
* If [truthy](https://masteringjs.io/tutorials/fundamentals/truthy), Mongoose will
* build an index on this path when the model is compiled.
*
* @api public
* @property index
* @memberOf SchemaTypeOptions
* @type {Boolean|Number|Object}
* @instance
*/
Object.defineProperty(SchemaTypeOptions.prototype, 'index', opts);
/**
* If [truthy](https://masteringjs.io/tutorials/fundamentals/truthy), Mongoose
* will build a unique index on this path when the
* model is compiled. [The `unique` option is **not** a validator](/docs/validation.html#the-unique-option-is-not-a-validator).
*
* @api public
* @property unique
* @memberOf SchemaTypeOptions
* @type {Boolean|Number}
* @instance
*/
Object.defineProperty(SchemaTypeOptions.prototype, 'unique', opts);
/**
* If [truthy](https://masteringjs.io/tutorials/fundamentals/truthy), Mongoose will
* disallow changes to this path once the document
* is saved to the database for the first time. Read more about [immutability in Mongoose here](https://thecodebarbarian.com/whats-new-in-mongoose-5-6-immutable-properties.html).
*
* @api public
* @property immutable
* @memberOf SchemaTypeOptions
* @type {Function|Boolean}
* @instance
*/
Object.defineProperty(SchemaTypeOptions.prototype, 'immutable', opts);
/**
* If [truthy](https://masteringjs.io/tutorials/fundamentals/truthy), Mongoose will
* build a sparse index on this path.
*
* @api public
* @property sparse
* @memberOf SchemaTypeOptions
* @type {Boolean|Number}
* @instance
*/
Object.defineProperty(SchemaTypeOptions.prototype, 'sparse', opts);
/**
* If [truthy](https://masteringjs.io/tutorials/fundamentals/truthy), Mongoose
* will build a text index on this path.
*
* @api public
* @property text
* @memberOf SchemaTypeOptions
* @type {Boolean|Number|Object}
* @instance
*/
Object.defineProperty(SchemaTypeOptions.prototype, 'text', opts);
/**
* Define a transform function for this individual schema type.
* Only called when calling `toJSON()` or `toObject()`.
*
* #### Example:
*
* const schema = Schema({
* myDate: {
* type: Date,
* transform: v => v.getFullYear()
* }
* });
* const Model = mongoose.model('Test', schema);
*
* const doc = new Model({ myDate: new Date('2019/06/01') });
* doc.myDate instanceof Date; // true
*
* const res = doc.toObject({ transform: true });
* res.myDate; // 2019
*
* @api public
* @property transform
* @memberOf SchemaTypeOptions
* @type {Function}
* @instance
*/
Object.defineProperty(SchemaTypeOptions.prototype, 'transform', opts);
module.exports = SchemaTypeOptions;

164
node_modules/mongoose/lib/options/VirtualOptions.js generated vendored Normal file
View file

@ -0,0 +1,164 @@
'use strict';
const opts = require('./propertyOptions');
class VirtualOptions {
constructor(obj) {
Object.assign(this, obj);
if (obj != null && obj.options != null) {
this.options = Object.assign({}, obj.options);
}
}
}
/**
* Marks this virtual as a populate virtual, and specifies the model to
* use for populate.
*
* @api public
* @property ref
* @memberOf VirtualOptions
* @type {String|Model|Function}
* @instance
*/
Object.defineProperty(VirtualOptions.prototype, 'ref', opts);
/**
* Marks this virtual as a populate virtual, and specifies the path that
* contains the name of the model to populate
*
* @api public
* @property refPath
* @memberOf VirtualOptions
* @type {String|Function}
* @instance
*/
Object.defineProperty(VirtualOptions.prototype, 'refPath', opts);
/**
* The name of the property in the local model to match to `foreignField`
* in the foreign model.
*
* @api public
* @property localField
* @memberOf VirtualOptions
* @type {String|Function}
* @instance
*/
Object.defineProperty(VirtualOptions.prototype, 'localField', opts);
/**
* The name of the property in the foreign model to match to `localField`
* in the local model.
*
* @api public
* @property foreignField
* @memberOf VirtualOptions
* @type {String|Function}
* @instance
*/
Object.defineProperty(VirtualOptions.prototype, 'foreignField', opts);
/**
* Whether to populate this virtual as a single document (true) or an
* array of documents (false).
*
* @api public
* @property justOne
* @memberOf VirtualOptions
* @type {Boolean}
* @instance
*/
Object.defineProperty(VirtualOptions.prototype, 'justOne', opts);
/**
* If true, populate just the number of documents where `localField`
* matches `foreignField`, as opposed to the documents themselves.
*
* If `count` is set, it overrides `justOne`.
*
* @api public
* @property count
* @memberOf VirtualOptions
* @type {Boolean}
* @instance
*/
Object.defineProperty(VirtualOptions.prototype, 'count', opts);
/**
* Add an additional filter to populate, in addition to `localField`
* matches `foreignField`.
*
* @api public
* @property match
* @memberOf VirtualOptions
* @type {Object|Function}
* @instance
*/
Object.defineProperty(VirtualOptions.prototype, 'match', opts);
/**
* Additional options to pass to the query used to `populate()`:
*
* - `sort`
* - `skip`
* - `limit`
*
* @api public
* @property options
* @memberOf VirtualOptions
* @type {Object}
* @instance
*/
Object.defineProperty(VirtualOptions.prototype, 'options', opts);
/**
* If true, add a `skip` to the query used to `populate()`.
*
* @api public
* @property skip
* @memberOf VirtualOptions
* @type {Number}
* @instance
*/
Object.defineProperty(VirtualOptions.prototype, 'skip', opts);
/**
* If true, add a `limit` to the query used to `populate()`.
*
* @api public
* @property limit
* @memberOf VirtualOptions
* @type {Number}
* @instance
*/
Object.defineProperty(VirtualOptions.prototype, 'limit', opts);
/**
* The `limit` option for `populate()` has [some unfortunate edge cases](/docs/populate.html#query-conditions)
* when working with multiple documents, like `.find().populate()`. The
* `perDocumentLimit` option makes `populate()` execute a separate query
* for each document returned from `find()` to ensure each document
* gets up to `perDocumentLimit` populated docs if possible.
*
* @api public
* @property perDocumentLimit
* @memberOf VirtualOptions
* @type {Number}
* @instance
*/
Object.defineProperty(VirtualOptions.prototype, 'perDocumentLimit', opts);
module.exports = VirtualOptions;

8
node_modules/mongoose/lib/options/propertyOptions.js generated vendored Normal file
View file

@ -0,0 +1,8 @@
'use strict';
module.exports = Object.freeze({
enumerable: true,
configurable: true,
writable: true,
value: void 0
});

14
node_modules/mongoose/lib/options/saveOptions.js generated vendored Normal file
View file

@ -0,0 +1,14 @@
'use strict';
const clone = require('../helpers/clone');
class SaveOptions {
constructor(obj) {
if (obj == null) {
return;
}
Object.assign(this, clone(obj));
}
}
module.exports = SaveOptions;