/*! * ignore */ /*! * @ignore */ /*! * Applies query middleware from this model's schema to this model's * Query constructor. */ /*! * Applies virtuals properties to `json`. */ /*! * Browser doc exposes the event emitter API */ /*! * Called internally by `openUri()` to create a MongoClient instance. */ /*! * Centralize this so we can more easily work around issues with people * stubbing out `process.nextTick()` in tests using sinon: * https://github.com/sinonjs/lolex#automatically-incrementing-mocked-time * See gh-6074 */ /*! * Check if the given document only has primitive values */ /*! * Compile other Buffer methods marking this buffer as modified. */ /*! * Connection states */ /*! * Convenience `valueOf()` to allow comparing ObjectIds using double equals re: gh-7299 */ /*! * Convert sort values */ /*! * Converts to POJO when you use the document for querying */ /*! * Create a new default connection (`mongoose.connection`) for a Mongoose instance. * No-op if there is already a default connection. */ /*! * Dependencies */ /*! * Document exposes the NodeJS event emitter API, so you can use * `on`, `once`, etc. */ /*! * Export */ /*! * Exports */ /*! * Exports. */ /*! * Get the default buffer timeout for this connection */ /*! * Get this schema's default toObject/toJSON options, including Mongoose global * options. */ /*! * Give the constructor the ability to emit events. */ /*! * Handle casting $elemMatch operators */ /*! * Helpers */ /*! * If _duplicateKeyErrorMessage is a string, replace unique index errors "E11000 duplicate key error" with this string. * * @api private */ /*! * If `docs` isn't all instances of the right model, depopulate `arr` */ /*! * If `translateAliases` option is set, call `Model.translateAliases()` * on the following query properties: filter, projection, update, distinct. */ /*! * If transaction was aborted, we need to reset newly inserted documents' `isNew`. */ /*! * Increment this document's version if necessary. */ /*! * Inherit from Buffer. */ /*! * Inherit from EventEmitter */ /*! * Inherit from EventEmitter. */ /*! * Inherit from Subdocument */ /*! * Inherit from abstract Collection. */ /*! * Inherit from the NodeJS document */ /*! * Inherits from Connection. */ /*! * Inherits from SchemaArray. */ /*! * Inherits from SchemaType. */ /*! * Internal helper for updateMany, updateOne */ /*! * Internal shallow clone alternative to `$toObject()`: much faster, no options processing */ /*! * Minimize _just_ empty objects along the path chain specified * by `parts`, ignoring all other paths. Useful in cases where * you want to minimize after unsetting a path. * * #### Example: * * const obj = { foo: { bar: { baz: {} } }, a: {} }; * _minimizePath(obj, 'foo.bar.baz'); * obj; // { a: {} } */ /*! * Module dependencies */ /*! * Module dependencies. */ /*! * Module exports */ /*! * Module exports. */ /*! * Module requirements */ /*! * Module requirements. */ /*! * Overwrite mquery's `_distinct`, because Mongoose uses that name * to store the field to apply distinct on. */ /*! * Permissions */ /*! * Populates `docs` for a single `populateOptions` instance. */ /*! * Recursively set nested arrays */ /*! * Recursively set options on implicitly created schemas */ /*! * Reset document state in between transaction retries re: gh-13698 */ /*! * Returns the value passed to it. */ /*! * Runs queued functions */ /*! * Sets this sub-documents parent document. * * @api private */ /*! * Split a string path into components delimited by '.' or * '[\d+]' * * #### Example: * stringToParts('foo[0].bar.1'); // ['foo', '0', 'bar', '1'] */ /*! * Valid mongoose options */ /*! * Virtuals defined on this array itself. */ /*! * define methods */ /*! * exports */ /*! * gt, gte, lt, lte, ne, in, nin, all, regex, size, maxDistance * * Thing.where('type').nin(array) */ /*! * ignore */ /*! * inherit mquery */ /*! * limit, skip, batchSize, comment * * Sets these associated options. * * query.comment('feed query'); */