MCPcopy Create free account

hub / github.com/Automattic/mongoose / functions

Functions1,512 in github.com/Automattic/mongoose

↓ 214 callersFunctionmodel
()
test/errors.validation.test.js:267
↓ 198 callersMethodcreate
Creates a new document or documents
types/models.d.ts:329
↓ 141 callersMethodfindOne
Finds one document.
types/models.d.ts:505
↓ 107 callersMethodget
* Overwrites native Map's `get()` function to support Mongoose getters. * * @api public * @method get * @memberOf Map
lib/types/map.js:56
↓ 101 callersMethodfind
Creates a `find` query: gets a list of documents that match `filter`.
types/models.d.ts:854
↓ 98 callersMethodset
* Overwrites native Map's `set()` function to support setters, `populate()`, * and change tracking. Note that Mongoose maps _only_ support strings
lib/types/map.js:106
↓ 95 callersMethodclose
()
lib/cursor/changeStream.js:201
↓ 92 callersMethodtoObject
(options)
lib/types/map.js:248
↓ 73 callersFunctionstart
(ctx)
test/tracing.test.js:42
↓ 71 callersMethodtoString
* toString helper * TODO remove? This defaults to `${this.name}: ${this.message}` * @api private
lib/error/validator.js:41
↓ 61 callersMethodadd
* Add a dotted path, like `settings.$*` or `profile.firstName`, to the trie. * * @param {string} path
lib/helpers/pathTrie.js:44
↓ 53 callersMethodfindById
* Finds a single document by its _id field. `findById(id)` is almost* * equivalent to `findOne({ _id: id })`. If you want to query by a document'
types/models.d.ts:454
↓ 53 callersMethodpopulate
Populates document references.
types/models.d.ts:738
↓ 52 callersMethoddeleteMany
* Deletes all of the documents that match `conditions` from the collection. * Behaves like `remove()`, but deletes all documents that match `cond
types/models.d.ts:364
↓ 52 callersMethodtest
(this: TestDoc)
test/types/loadclass.test.ts:166
↓ 49 callersMethodhas
* Overwrites native Map's `has()` function to support ObjectIds as keys. * * @api public * @method has * @memberOf Map
lib/types/map.js:76
↓ 47 callersMethoddiscriminator
Adds a discriminator type.
types/models.d.ts:416
↓ 42 callersMethodvalidate
Casts and validates the given object against this model's schema, returning the casted-and-validated copy of `obj`, passing the given `context` to cus
types/models.d.ts:767
↓ 39 callersMethodfindOneAndUpdate
Creates a `findOneAndUpdate` query: atomically find the first document that matches `filter` and apply `update`.
types/models.d.ts:1496
↓ 37 callersMethodinit
* This function is responsible for building [indexes](https://www.mongodb.com/docs/manual/indexes/), * unless [`autoIndex`](http://mongoosejs.com
types/models.d.ts:640
↓ 36 callersMethodupdateOne
Creates a `updateOne` query: updates the first document that matches `filter` with `update`.
types/models.d.ts:1728
↓ 35 callersMethodcast
(val, doc, init, prev, options)
lib/schema/union.js:34
↓ 35 callersFunctionclone
* Object clone with Mongoose natives support. * * If options.minimize is true, creates a minimal data object. Empty objects and undefined values wil
lib/helpers/clone.js:33
↓ 33 callersMethodvalueOf
()
test/helpers/clone.test.js:229
↓ 32 callersFunctiondone
(err)
lib/model.js:1704
↓ 30 callersMethodinsertMany
Inserts one or more new documents as a single `insertMany` call to the MongoDB server.
types/models.d.ts:643
↓ 30 callersMethodtoJSON
()
lib/error/cast.js:33
↓ 28 callersMethodclone
()
lib/schema/union.js:124
↓ 27 callersMethodaggregate
(pipeline?: PipelineStage[], options?: AggregateOptions)
types/models.d.ts:243
↓ 26 callersFunctionget
()
lib/model.js:4469
↓ 25 callersMethodwhere
Creates a Query, applies the passed conditions, and returns the Query.
types/models.d.ts:1740
↓ 23 callersMethodbulkWrite
* Sends multiple `insertOne`, `updateOne`, `updateMany`, `replaceOne`, * `deleteOne`, and/or `deleteMany` operations to the MongoDB server in one
types/models.d.ts:285
↓ 23 callersFunctionisBsonType
* Determines if `obj` has the given BSON type. * @api private
lib/helpers/isBsonType.js:8
↓ 22 callersMethoddeleteOne
* Deletes the first document that matches `conditions` from the collection. * Behaves like `remove()`, but deletes at most one document regardles
types/models.d.ts:392
↓ 21 callersMethodcollection
()
test/driver.test.js:26
↓ 20 callersMethodcountDocuments
Creates a `countDocuments` query: counts the number of documents that match `filter`.
types/models.d.ts:305
↓ 20 callersMethodhydrate
* Shortcut for creating a new Document from existing raw data, pre-saved in the DB. * The document returned has no paths marked as modified initi
types/models.d.ts:625
↓ 19 callersMethodfindOneAndDelete
Creates a `findOneAndDelete` query: atomically finds the given document, deletes it, and returns the document as it was before deletion.
types/models.d.ts:1184
↓ 19 callersMethodinsertOne
* Shortcut for saving one document to the database. * `MyModel.insertOne(obj, options)` is almost equivalent to `new MyModel(obj).save(options)`.
types/models.d.ts:726
↓ 19 callersMethodon
(event, handler)
lib/cursor/changeStream.js:185
↓ 18 callersMethodapplySetters
(val, doc, init, prev, options)
lib/schema/union.js:62
↓ 16 callersMethodfindByIdAndUpdate
Creates a `findOneAndUpdate` query, filtering by the given `_id`.
types/models.d.ts:1072
↓ 16 callersFunctionfn
()
test/parallelLimit.test.js:17
↓ 15 callersMethodfindOneAndReplace
Creates a `findOneAndReplace` query: atomically finds the given document and replaces it with `replacement`.
types/models.d.ts:1322
↓ 15 callersMethodinspect
()
lib/types/map.js:294
↓ 14 callersFunctionbuildMiddlewareFilter
* Builds a filter for kareem's execPre/execPost based on middleware options. * * @param {object} options - Options object that may contain `middlewa
lib/helpers/buildMiddlewareFilter.js:18
↓ 14 callersMethodnext
(cb)
lib/cursor/changeStream.js:119
↓ 14 callersMethodupdateMany
Creates a `updateMany` query: updates all documents that match `filter` with `update`.
types/models.d.ts:1716
↓ 13 callersMethodcreateCollection
* Create the collection for this model. By default, if no indexes are specified, * mongoose will not create the collection for the model until an
types/models.d.ts:342
↓ 13 callersMethoddelete
* Overwrites native Map's `delete()` function to support change tracking. * * @api public * @method delete * @memberOf Map
lib/types/map.js:227
↓ 13 callersMethoddistinct
Creates a `distinct` query: returns the distinct values of the given `field` that match `filter`.
types/models.d.ts:785
↓ 13 callersFunctionnext
(cb)
test/helpers/cursor.eachAsync.test.js:15
↓ 12 callersMethodreplaceOne
Creates a `replaceOne` query: finds the first document that matches `filter` and replaces it with `replacement`.
types/models.d.ts:1694
↓ 11 callersMethodcast
(val)
test/document.test.js:8357
↓ 10 callersFunction_updateParentPopulated
* If this is a document array, each element may contain single * populated paths, so we need to modify the top-level document's * populated cache. S
lib/types/documentArray/methods/index.js:539
↓ 10 callersMethodonce
(event, handler)
lib/cursor/changeStream.js:193
↓ 10 callersMethodsyncIndexes
* Makes the indexes in MongoDB match the indexes defined in this model's * schema. This function will drop any indexes that are not defined in
types/indexes.d.ts:49
↓ 9 callersFunction_updateSubdocIndexes
(arr)
lib/types/documentArray/methods/index.js:515
↓ 9 callersMethodbulkSave
* Sends multiple `save()` calls in a single `bulkWrite()`. This is faster than * sending multiple `save()` calls because with `bulkSave()` there
types/models.d.ts:299
↓ 9 callersFunctioncb
()
test/index.test.js:683
↓ 9 callersMethodfindByIdAndDelete
Creates a `findByIdAndDelete` query, filtering by the given `_id`.
types/models.d.ts:990
↓ 8 callersMethodgetEmbeddedSchemaType
* Returns the embedded schema type (i.e. the `.$*` path) * * @api public
lib/schema/map.js:100
↓ 7 callersMethod$init
(key, value)
lib/types/map.js:34
↓ 7 callersMethodestimatedDocumentCount
Creates a `estimatedDocumentCount` query: counts the number of documents in the collection.
types/models.d.ts:819
↓ 7 callersMethodtoJSONSchema
* Returns this schema type's representation in a JSON schema. * * @param {object} [options] * @param {boolean} [options.useBsonType=false] If
lib/schema/union.js:138
↓ 6 callersMethodaddError
* add message * @param {string} path * @param {string|Error} error * @api private
lib/error/validation.js:53
↓ 6 callersMethoddoValidate
(value, scope, options)
lib/schema/union.js:98
↓ 6 callersMethodexists
* Returns a document with its `_id` if at least one document exists in the database that matches * the given `filter`, and `null` otherwise.
types/models.d.ts:832
↓ 6 callersFunctionhandleTimestampOption
(arg, prop)
lib/helpers/schema/handleTimestampOption.js:9
↓ 6 callersMethodopenUri
()
test/driver.test.js:30
↓ 6 callersMethodstartSession
* Starts a [MongoDB session](https://www.mongodb.com/docs/manual/release-notes/3.6/#client-sessions) * for benefits like causal consistency, [ret
types/session.d.ts:26
↓ 6 callersMethodwatch
Watches the underlying collection for changes using [MongoDB change streams](https://www.mongodb.com/docs/manual/changeStreams/).
types/models.d.ts:773
↓ 5 callersMethodcreateIndexes
* Similar to `ensureIndexes()`, except for it uses the [`createIndex`](https://mongodb.github.io/node-mongodb-native/7.0/classes/Collection.html#creat
types/indexes.d.ts:20
↓ 5 callersFunctionisOperator
* Checks whether an object is likely a pipeline operator * * @param {object} obj object to check * @return {boolean} * @api private
lib/aggregate.js:1237
↓ 5 callersMethodlistIndexes
* Lists the indexes currently defined in MongoDB. This may or may not be * the same as the indexes defined in your schema depending on whether yo
types/indexes.d.ts:41
↓ 5 callersMethodmyMethod
()
test/types/models.test.ts:268
↓ 5 callersMethodsetModel
(model)
lib/error/cast.js:78
↓ 4 callersFunction_checkManualPopulation
(arr, docs)
lib/types/array/methods/index.js:1046
↓ 4 callersFunctionapplyTimestampsToChildren
* Apply timestamps to any subdocuments * * @param {Schema} schema subdocument schema * @param {object} res subdocument * @param {object} [options]
lib/helpers/document/applyTimestamps.js:38
↓ 4 callersMethodbyName
(this: QueryWithHelpers<any, ITest, QueryHelpers>, name: string)
test/types/queries.test.ts:26
↓ 4 callersMethodcastObject
(obj: AnyObject, options?: { ignoreCastErrors?: boolean })
types/models.d.ts:264
↓ 4 callersMethodclear
* Overwrites native Map's `clear()` function to support change tracking. * * @api public * @method clear * @memberOf Map
lib/types/map.js:211
↓ 4 callersFunctioncreateTracedChannel
(name)
lib/tracing.js:20
↓ 4 callersMethoddiffIndexes
* Does a dry-run of Model.syncIndexes(), meaning that * the result of this function would be the result of * Model.syncIndexes().
types/indexes.d.ts:27
↓ 4 callersMethodfindByName
(name: string)
test/types/plugin.test.ts:101
↓ 4 callersFunctionscrollThreadToBottom
()
docs/js/ask-ai.js:308
↓ 3 callersMethod$toObject
()
lib/types/map.js:261
↓ 3 callersMethod_bindEvents
()
lib/cursor/changeStream.js:56
↓ 3 callersFunction_castMinMaxDistance
(self, val)
lib/schema/operators/geospatial.js:100
↓ 3 callersFunction_setIsNew
(doc, val, hasOnlyPrimitiveValues)
lib/model.js:3351
↓ 3 callersFunctionapplyTimestampsToChildren
(now, update, schema)
lib/helpers/update/applyTimestampsToChildren.js:12
↓ 3 callersFunctionapplyTimestampsToUpdate
(now, createdAt, updatedAt, currentUpdate, options, upsert, isReplace)
lib/helpers/update/applyTimestampsToUpdate.js:16
↓ 3 callersMethodbar
()
test/types/models.test.ts:37
↓ 3 callersFunctioncast$geometry
(val, self)
lib/schema/operators/geospatial.js:40
↓ 3 callersFunctionclone
()
test/helpers/clone.test.js:175
↓ 3 callersFunctiondefineKey
* Defines the accessor named prop on the incoming prototype. * @param {object} options * @param {string} options.prop * @param {boolean} options.su
lib/helpers/document/compile.js:68
↓ 3 callersMethoddoValidateSync
(value, scope, options)
lib/schema/union.js:112
↓ 3 callersFunctioneachAsync
()
test/types/queries.test.ts:458
↓ 3 callersMethodensureIndexes
* Sends `createIndex` commands to mongo for each index declared in the schema. * The `createIndex` commands are sent in series.
types/indexes.d.ts:33
↓ 3 callersFunctionfetch
(done)
lib/helpers/cursor/eachAsync.js:81
next →1–100 of 1,512, ranked by callers