Refactoring day1
This commit is contained in:
25
node_modules/mongoose/lib/schema/documentarray.js
generated
vendored
25
node_modules/mongoose/lib/schema/documentarray.js
generated
vendored
@@ -361,11 +361,6 @@ DocumentArrayPath.prototype.cast = function(value, doc, init, prev, options) {
|
||||
// lazy load
|
||||
MongooseDocumentArray || (MongooseDocumentArray = require('../types/documentarray'));
|
||||
|
||||
// Skip casting if `value` is the same as the previous value, no need to cast. See gh-9266
|
||||
if (value != null && value[arrayPathSymbol] != null && value === prev) {
|
||||
return value;
|
||||
}
|
||||
|
||||
let selected;
|
||||
let subdoc;
|
||||
const _opts = { transform: false, virtuals: false };
|
||||
@@ -518,26 +513,6 @@ function scopePaths(array, fields, init) {
|
||||
return hasKeys && selected || undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a default option for all DocumentArray instances.
|
||||
*
|
||||
* ####Example:
|
||||
*
|
||||
* // Make all numbers have option `min` equal to 0.
|
||||
* mongoose.Schema.DocumentArray.set('_id', false);
|
||||
*
|
||||
* @param {String} option - The option you'd like to set the value for
|
||||
* @param {*} value - value for option
|
||||
* @return {undefined}
|
||||
* @function set
|
||||
* @static
|
||||
* @api public
|
||||
*/
|
||||
|
||||
DocumentArrayPath.defaultOptions = {};
|
||||
|
||||
DocumentArrayPath.set = SchemaType.set;
|
||||
|
||||
/*!
|
||||
* Module exports.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user