defaults
option on result documents from query options #7287 IslandRhythmspathsToValidate
to validate()
and validateSync()
#10258loadClass()
on classes that have collection
as a static property #10257 #10254 IslandRhythmsvirtualsOnly
parameter to loadClass()
function signature IslandRhythmsoptions
as first parameter #10216toJSON()
function to ensure name
property always ends up in JSON.stringify()
output #10166 IslandRhythmsallowDiskUse
option #10177insertMany()
#10144extends Document
#10144UpdateWithAggregationPipeline
for cases when UpdateQuery
is used as a function param #10186useFindAndModify
and useCreateIndex
deprecation warnings #10155process.nextTick()
to avoid clean stack traces causing memory leak when using synchronous recursion like async.whilst()
#9864writeConcern
schema option to work around MongoDB driver's writeConcern
deprecation warning #10083 #10009 IslandRhythmslocalField
filter to $elemMatch
on virtual populate when custom match
has a $elemMatch
and foreignField
is an array #10117save()
when using optimisticConcurrency
if no changes in document #10128 IslandRhythmsobj
as context
in Model.validate()
if obj
is a document #10132useDb()
with useUnifiedTopology
#8267create()
and insertMany()
#10144eachAsync()
callback receives a single doc rather than array of docs unless batchSize
is set #10135validateSync()
is a ValidationError #10147 michaln-qautoCreate
value from Mongoose global when creating new model before calling connect()
#10091type: Boolean
in Schema definitions #10085updateOne()
and updateMany()
#10095deleteOne()
, deleteMany()
#10122useCreateIndex
always false
in docs #10033_id
property #10069.$*
#10123transform()
function for single conventional populate #10064T
to use T & Document
internally #10046$pull
with $
paths #10075Date
type for $currentDate
#10058$unset
properties to be any value #10066index
property to a string #10077writeConcern()
method to avoid writeConcern deprecation warning #10009createCollection()
and other helpers to avoid event emitter warning #9778Connection#id
to Mongoose instance so id always lines up with mongoose.connections
index #10025 IslandRhythmspromiseOrCallback()
if 3rd param isn't an EventEmitter #10055 emrebassModel.discriminator()
#10054 coro101next()
callback for pre('insertMany')
hooks #10078 #10072 pezzutransform
to PopulateOptions interface #10061post('find')
hooks with an array of docs #10015 #9982 IslandRhythmsref
as an option on an array SchemaType #10029select
option from array schematypes #10029Schema()
constructor #10035 zpbrentQueryWithHelpers
so query helpers pass through chaining #10040upserted
array to updateOne()
, updateMany()
, update()
result #10042Aggregate#project()
types that were mistakenly removed in 5.12.0 #10043type
in Schema to a SchemaType class or a Schema instance #10030session.withTransaction()
before session.startTransaction()
because withTransaction()
is the recommended approach #10008mongoose.Types
#10016toObject()
use child schema flattenMaps
option by default #9995isValidObjectId()
check that length 24 strings are hex chars only #10010 #9996 IslandRhythmspopulated()
check when calling applyGetters()
with a POJO for mongoose-lean-getters support #9986this
for query helpers #10028 francescov1SchemaType#cast()
#10039 #9980SchemaType#OptionsConstructor
#10001findByIdAndUpdate()
with filter, update, callback params #9981transform
option that Mongoose will call on every populated doc #3775Query#pre()
and Query#post()
public #9784Document#getPopulatedDocs()
to return an array of all populated documents in a document #9702 IslandRhythmsDocument#getAllSubdocs()
to return an array of all single nested and array subdocuments #9764 IslandRhythmsschema
as a schema path name #8798 IslandRhythmsnoListener
option to help with use cases where you're using useDb()
on every request #9961mongoose.createConnection()
#9985explain
option to Model.exists()
#8098 IslandRhythmsdb
events deprecation warning with 'close' events #10004 #9930$pull
more permissive to allow dotted paths #9993validateModifiedOnly
is set #9963findOneAndReplace()
#9951loadClass()
#9975Schema
constructor #9969type
to an array of schemas when using SchemaDefinitionType #9962disconnected
if connecting string failed to parse #9921db
events deprecation warning if useUnifiedTopology = true
#9930PopulatedDoc
type to make it easier to define populated docs in interfaces #9818toObject()
return type for backwards compatibility #9944any
from deleteX()
and updateX()
query params and return values #9959 btdModel.create()
for better autocomplete #9928>
in API descriptions #9940perDocumentLimit
when multiple documents reference the same populated doc #9906SchemaTypeOptions#type
optional again to allow alternative typeKeys #9927{ type: String }
in schema definition when using SchemaDefinitionType generic #9911$*
syntax for populating every entry in a map #9907Connection#transaction()
promise resolves to a command result #9919$function
operator #9897isSelected
as an path in a nested schema #9884 #9873 IslandRhythmsSchemaDefinition
generics when creating schema #9863 #9862 #9789Query
a class, allow calling Query#where()
with object argument and with no arguments #9856Schema#pre()
and Schema#post()
with options and array of hooked function names #9844justOne
from parent when populating a POJO with a manually populated path #9833 IslandRhythmsdocumentIsSelected
symbol #9841 IslandRhythmsDocument#remove()
returns a promise, not a query #9826SchemaType#enum
to TypeScript enum with required: true
#9546Connection#transaction()
#9834 pnutmathQuery#options#rawResult
take precedence over new
+upsert
#9816mongoose.Promise
#9820Aggregate#replaceRoot()
#9814Model.create()
with a spread return a promise of array rather than single doc #9817toObject
for populate virtuals #9822db
as a document path #9798onOpen()
if autoCreate === false
#9807findOneAndUpdate()
and findByIdAndUpdate()
with rawResult = true
#9803new: true
or returnOriginal: false
to skip null check with findOneAndUpdate()
#9654create()
with undefined
as first argument and no callback #9765this
refers to DocType
in schema methods with strict mode #9755Aggregate#addFields()
#9774min
and max
to [number, string] and [Date, string] #9762Schema#methods
and Schema#statics
#9717populate
option for insertMany()
as a workaround for mongoose-autopopulate #9720arrayPath
when casting to a non-array, avoid unnecessarily setting atomics #9588String#slice()
call when creating a new array #9588lean.virtuals
in place #9754Aggregate#project()
#9763 vorticalboxnull
as an enum value for schematypes #9746save()
promise resolves to #9689defaults
option to subdocument arrays #9736lean()
result type #9728id
paths with non-string values in TypeScript #9723createIndexes()
and ensureIndexes()
with just callback #9706__v
in LeanDocuments #9687Aggregate#append()
#9714toObject
#9700createIndexes()
and ensureIndexes()
#9706ValidateOpts.message
#9697get()
with empty string returns undefined for mongoose-plugin-autoinc #9681isNew
to false for documents that were successfully inserted by insertMany
with ordered = false
when an error occurred #9677Document#id
optional so types that use id
can use Model<IMyType & Document>
#9684create()
and findOneAndReplace()
#9676mongoose.model()
and Connection#model()
with model as generic param #9685 #9678 sahasayannull
in maps of subdocs #9628validate
#9667VirtualType#applyGetters()
and applySetters()
, Schema#virtuals
, Schema#childSchemas
, Query#_mongooseOptions
#9658id
to LeanDocuments in case it is defined in the user's schema #9657upsert
and orFail()
#9654insertMany()
more consistent #9662SchemaTypeOpts
and ConnectionOptions
aliases for backwards compatsort()
from limit
example to avoid potential confusion #9584Document#__v
so documents have a Version by default #9652 sahasayansession
option to SaveOptions
#9642Schema#paths
, Schema#static(obj)
, Embedded#schema
, DocumentArray#schema
, make Schema inherit from EventEmitter #9650FilterQuery
#9649find()
, findOne()
, findById()
#9648Document#parent()
method because it conflicts with existing user code #9645Connection#db
property #9643tsconfig.json
file for intellisense #9611 alecgibsonDocument#_id
so documents have an id by default #9632LeanDocument
with arrays #9620ModelUpdateOptions
as alias for QueryOptions
for backwards compat #9637findById()
function #9626 #9620_id
for Document, support creating Mongoose globals and accessing collection name #9618get()
and set()
#9616new
and returnOriginal
options to QueryOptions, add missing model static properties #9627 #9616 #9615useCreateIndex
in connection options #9621$set
in updates #9609createConnection()
as a connection as well as a promise #9612 #9610 alecgibsonTypes.ObjectId()
without new
in TypeScript #9608index.d.ts
file #8108localField
and foreignField
as arrays #6608get
option for Schema#virtual()
#9343populate
schematype option that sets default populate options #6029populate()
in batch when using batchSize
#9366 biomorgothoverwriteModels
option to bypass OverwriteModelError
globally #9406deepEqual()
on documents and arrays #9396enum
validator in schema #9547 #9546 AbdelrahmanHafezshell
option for date format (ISODate) #9532 FlameFractalget()
, set()
#9375Document#$isValid()
, isDirectSelected()
, isSelected()
, $isDefault()
#9474minLength
and maxLength
behave the same as minlength
and maxlength
#8777 m-weeks$parent()
as an alias for parent()
for documents and subdocuments to avoid path name conflicts #9455$type
in query filters #9577useDb()
#9569of
for array type definitions to be consistent with maps #9564Array#toObject()
returns a vanilla JavaScript array in Node.js 6+ #9540disconnect()
stop Mongoose if it is trying to reconnect #9531Document#overwrite()
correctly overwrites maps #9549increment
as a schema path name #9538partialFilterExpression
for indexes in discriminator schemas #9542$setOnInsert
#9537document
and query
on remove
hooks to get just document middleware #9530 mustafaKamal-festartSession()
#9515deleteOne
and deleteMany
trigger middleware #9504ssl
defaulting to true
for srv connection strings #9511mongoose.connect()
multiple times in parallel, make 2nd call wait for connection before resolving #9476save()
persist Map#clear()
#9493$match
as the 2nd stage in pipeline rather than 1st #9487autoCreate
as a global option to be consistent with autoIndex
#9466mongoose.model()
with schema from a different Mongoose module instance #9449reason
on cast errors that occur while init-ing a document #9448createCollection()
not throw error when collection already exists to be consistent with v5.9 #9447required
can use arrow functions #9435 AbdelrahmanHafezisSelected
#9438Schema#clone()
use parent Mongoose instance's Schema constructor #9426options.perDocumentLimit
option same as perDocumentLimit
when calling populate()
#9418minimize
if toObject()
is called without an explicit minimize
#9405findOneAndRemove()
with orFail()
#9381_id
option to false
after instantiating schema #9390getChanges()
#9376Schema#add()
with schematype instances with different paths #9370Query#get()
example #9372 elainewlininsertMany()
fails due to server selection error #9355pull()
on a document array when _id
is an alias #9319.$
#9361mongoose.model()
#7723.then()
is not a function error when calling mongoose.connect()
multiple times #9358 #9335 #9331create()
after bulkWrite()
by clearing internal casting context #9350save()
is in-flight #9327refPath
if the path to populate is undefined #9340default
on array #9351schema.pre(..., { document: false })
#9316retainNullValues
when setting _id
to false
for subdocument #9337 #9336 FelixRe0Connection#transaction()
helper that handles resetting Mongoose document state if the transaction fails #8380optimisticConcurrency
option to use OCC for save()
#9001 #5424Aggregate#search()
for Atlas Text Search #9115setDefaultsOnInsert
as a global option #9036 AbdelrahmanHafezreturnOriginal
as a global option #9189 #9183 AbdelrahmanHafezdefaults
option to disable adding defaults to a single document #8271set()
function for global options, support setting _id
globally #8883$or
when each clause contains a different discriminator key #9018findOneAndUpdate()
, updateOne()
, etc. #6087mongoose.connect()
while already connected a no-op #9203getClient()
and setClient()
function for interacting with a connection's underlying MongoClient instance #9164parent()
function that allows you to get the parent document for populated docs #8092useProjection
option to toObject()
and toJSON()
for hiding deselected fields on newly created documents #9118syncIndexes()
report error if it can't create an index #9303name
and message
show up on individual ValidatorErrors when calling JSON.stringify() on a ValidationError #9296match
schema validator with /g
flag #9287undefined
#9275bulkWrite()
updates when not using $set
#9268extends Error
#9273invalidate()
methods have the same return value as top-level document #9271create()
docs use async/await, and add another warning about how create()
with options requires array syntax #9280validateModifiedOnly
option works #9263discriminator()
#9238bufferCommands = false
#9239syncIndexes()
#9225bufferCommands
option if mongoose.connect()
is called after mongoose.model()
#9179priorDoc
after overwriting single nested subdoc so changes after overwrite get persisted correctly #9208bufferMaxEntries
when setting bufferCommands
#9218Model.hydrate()
#9209null
to schema boolean's convertToFalse
set #9223find
and findOne()
examples use async/await and clarify find({})
is find all #9210_bsontype
property in queries to prevent silent empty queries #8222syncIndexes()
error when db index has a collation but Mongoose index does not #9224 clhuangtransform
option #9211{ type: mongoose.Schema.Types.Array }
as equivalent to { type: Array }
#9194connect()
multiple times #9167typeKey
option to implicitly created schemas from typePojoToMixed
#9185 joaoritterrefPath
with multiple documents #9153perDocumentLimit
and multiple documents #9175transform
functions that return promises #9176 #9163 AbdelrahmanHafezopenUri()
on an already open connection #9107update
values in bulkWrite #9160 #9157 AbdelrahmanHafezrequired
validator on single nested subdoc correctly when calling Schema#clone()
#8819tiedValue
when casting update on nested paths #9108typePojoToMixed
#9085globalSetup
with Jest #9063const
instead of var
in examples #9125 dmcgrouther$locals
when initializing document #9099 #9098 AbdelrahmanHafezsetDefaultsOnInsert
a mongoose option so it doesn't end up in debug output #9086connect()
and openUri()
options #9071splice()
on slice()-ed arrays #9011$and
, $or
, $nor
contain non-object values #8948$__.scope
property a symbol instead to work around a bug with fast-safe-stringify #8955unshift()
after map()
#9012 philippejerdb
from reserved keywords #8940ref
as a no-op #8946insertedDocs
on insertMany()
errors #8938writeErrors
property on insertMany error with ordered: false
, even if only one op failed #8938Error.prototype.toJSON
read only #8986 osherkind
to cast errors thrown by query execution #8953 AbdelrahmanHafezsave()
docs #8956 AbdelrahmanHafezdistinct()
#8906 clhuangminimize: false
#8829clone
with lean
when setting a path to null
#8807markModified()
#8854$set()
on object keys if object path isn't in schema #8751select: false
in schema #8818 #8806 AbdelrahmanHafezinit()
as opposed to once('index')
in unique
example #8816insertMany()
return value #8820 dandvstrict
option #8782 #8788 AbdelrahmanHafezclone
option with lean
#8761 #8760endSession()
in all transactions examples #8741returnOriginal
option #8766Map#get()
#8730refPath
function in embedded discriminator #8731exists()
when no changes to save #8764 #8739 AbdelrahmanHafezuseNestedStrict: false
when updating a single nested path #8735modelName
as a schema path, since modelName
is a static property on models #7967exec()
with queries and await
#8747connectTimeoutMS
doesn't do anything with useUnifiedTopology
, should use serverSelectionTimeoutMS
#8721strict
and upsert
are set and filter
contains a non-schema path #8698castToNumber()
allow undefined #8725 p3x-robotnestedArr.0
#8689execPopulate()
to "populate an existing document" section #8671 #8275useUnifiedTopology: true
#8643slice()
after push()
#8668 #8655 AbdelrahmanHafezkey
to the same value #8652Mixed
update validator on dotted path underneath mixed type #8659limit
applies if one document being populated has more than limit
results #8657limit
and perDocumentLimit
are set #8661 #8658 AbdelrahmanHafezrawResult
option #8662loadClass()
#8623Query#populate()
example to clarify that sort
doesn't affect the original result's order #8647new Model(doc)
to set immutable properties when doc is a mongoose document #8642unshift()
after slice()
#8482typePojoToMixed
to implicitly created arrays #8627typePojoToMixed
option to schemas implicitly created because of typePojoToMixed
#8627background
option to syncIndexes()
#8645_id
path in schemas #8625match
with virtual populate #8616validate()
with single nested subpath only validate that single nested subpath #8626mongoose.model()
return a class in the browser to allow hydrating populated data in the browser #8605syncIndexes()
and cleanIndexes()
drop compound indexes with _id
that aren't in the schema #8559useUnifiedTopology
#8604options.timestamps
parameter docs to findOneAndUpdate()
and findByIdAndUpdate()
#8619_doc
#8565runValidators
#8580deleteOne
hooks only on Document#deleteOne()
when setting options.document = true
for Schema#pre()
#8555validate()
in post validate hook without causing parallel validation error #8597autoCreate
set to false
#8566Aggregate#unwind()
can take object parameters as well as strings #8594save()
with no changes #8571Object.values()
for Node.js 4.x-6.x support #8596eachAsync()
with parallel
and a sync callback #8577trim
on all strings, etc.) #8487perDocumentLimit
option that limits per document in find()
result, rather than across all documents #7318transform
option on individual schematypes #8403currentTime
option for setting custom function to get the current time #3957Connection#watch()
to watch for changes on an entire database #8425Document#$op
property to make it easier to tell what operation is running in middleware #8439limit
as top-level populate option #8445$id
with $elemMatch
#8577refPath
but none of the subdocs have refPath
#8553validate()
multiple times in parallel on subdocs to avoid errors if Mongoose double-validates taxilian #8548 #8539mongoose.connect()
after connection helpers on the same tick #8534mongoose.connect()
or mongoose.createConnection()
is not a function #8556utils.merge()
samgladstone #8542refPath
#8527cleanIndexes()
drops indexes with different collations #8521insertMany
lean
option #8522authSource
option #8517refPath
#8499lean
with insertMany()
#8507 #8234 ntsekourastypePojoToMixed
as top-level option #8501 #8500 AbdelrahmanHafez_id
getter for ObjectIds in populate docs #8483splice()
after slice()
on an array #8482validate()
multiple times on the same document #8468name = 'ValidationError'
#8466localField
is undefined in the database #8455mongoose.connect()
server selection timeouts in MongooseTimeoutError for more readable stack traces #8451foreignField
from projection by prefixing with -
#8460refPath
when not all discriminator schemas have refPath
#8452enum
on array if an array of numbers #8449_id
option for document array schematypes #8450.add()
-ed paths when calling .add()
with schema argument #8429Query#cursor()
#8421parallel
is greater than number of documents #8422DocumentNotFoundError
if underlying document deleted but no changes made #8428 #8371 AbdelrahmanHafezlimit
option for populate and suggest workaround #8409$embeddedSchemaType
property to arrays for consistency with document arrays #8389MongooseTimeoutError
to retain original stack trace #8259Model.validate()
function that validates a POJO against the model's schema #7587Schema#pick()
function to create a new schema with a picked subset of the original schema's paths #8207cast
option to SchemaType #8300enum
validator for number type #8139_id
as an option to single nested schema paths #8137MongooseArray#push()
support using $position
#4322updateOne()
document middleware pass this
to post hooks #8262explain()
#5887session
option to docs for findOneAndX() methods #8396eachAsync()
functions finish before resolving the promise #8352message
function to SchemaType#validate()
as positional arg #8360uppercase
, lowercase
, and trim
options for SchemaString don't affect RegExp queries #8333Connection#models
property #8314push()
on a doc array with no parent #8351 #8317 #8312 AbdelrahmanHafezmongoose.isValidObjectId()
function to test whether Mongoose can cast a value to an objectid #3823excludeIndexes
as schema option for subdocs #8343setTimeout()
in eachAsync()
, 4x speedup in basic benchmarks #8310retainNullValues
set array element to null
if foreign doc with that id was not found #8293toBSON()
to make it to save()
#8299populated()
when updating document array with populated subpaths #8265_id: false
in schema after nesting in another schema #8274.discriminator()
#8287toObject()
options are applied to subdocs #8260eachAsync()
cursor #8249 #8235close
events from useUnifiedTopology don't disconnect Mongoose from replica set #8224Document
constructor directly in Node.js #8237populated()
when calling DocumentArray#push()
#8247type
property #8227_bsontype
property in queries to prevent silent empty queries #8222required: null
and required: undefined
as required: false
#8219options
to Model.remove()
#8211Document#set()
merge option when setting underneath single nested schema #8201fromIndex
parameter #8203$pull
as a query instead of an update for document arrays #8166isAsync
from validation docs in favor of emphasizing promises #8184mongoose.set('autoIndex', false)
#8158tiedValue
parameter for embedded discriminators analagous to top-level discriminators #8164toConstructor()
with entries-style sort syntax #8159Mixed
#8157findOneAndUpdate()
with runValidators
#8151 fernandolguevarauseUnifiedTopology
option to connect()
and openUri()
docs #8146Query#get()
to make writing custom setters that handle both queries and documents easier #7312aliases: false
option to Document#toObject()
#7548justOne = undefined
#8125 taxilianclone()
#8111discriminator()
calls #2874toString()
to convert an object to a string #8112 TheTrueRandomasync.parallelLimit()
for insertMany()
#8073exists()
#8075validateUpdatedOnly
option handle pre-existing errors #8091find()
on a nested array #8089setOptions()
#8099null
options when checking immutability #8070 rich-earthSchema#path()
to get schema path underneath doc array #8057{ type: 'ObjectID' }
, last 'D' case insensitive #8034findOneAndReplace()
work with orFail()
#8030= exports
syntax #8026session
in docs and MongoDB driver ClientSession class, link to driver docs #8009timestamps: false
in child schema #8007new
option to findOneAndX()
as an alternative to returnOriginal
#7846inspect()
never return null
, because a document or nested path is never == null
#7942Schema#pre(Array)
#8022 Mangosteen-YangQuery#populate()
#7341refPath
in discriminator when populating top-level model #5109set()
, etc. #6039instanceof
their parent types #5005validators
a private property that doesn't show up in for/in #6572mongoose.connect()
, mongoose.createConnection()
, and conn.openUri()
#7976mongoose.set()
instead of mongoose.use()
#7998new Model.discriminator()
#7957cast()
function #7975 perfectstorm88once
property successfully #7958select
overwrites child path select
if parent is nested #7945clone()
correctly copy array embedded discriminators #7954Schema#pathType()
returns correct path type given non-existent positional path #7935closed
if emitting close event #7930Query#select()
#7953 rayhatfieldsetOptions()
work as advertised #7950 #6011 cdimitroulasupdate()
with immutable createdAt
#7917doc
parameter to save() error handling middleware #7832useCache
option for useDb()
#7923mongoose.connect()
multiple times while connected #7905 Fongerpopulate()
#7913 rayhatfieldError
rather than MongooseError
#7867immutable
option to disallow changing a given field #7671Model.exists()
function to quickly check whether a document matching filter
exists #6872maxTimeMS
ref
to a function for conventional populate #7669PopulateOptions#connection
option to allow cross-db populate with refPath #6520getFilter()
as an alias of getQuery()
to be more in line with API docs #7839util.inspect()
#7836createIndex()
on indexes that are defined in the base schema #7379of
automatically convert POJOs to schemas unless typeKey is set #7859numAffected
and result
to DocumentNotFoundError for better debugging #7892 #7844refPath
with virtual populate #7848withTransaction()
helper #7598projetion
to projection
#7868 dfdeagle47schema
#7831findOneAndReplace()
#7654updateOne()
and updateMany()
to list of update validator operations #7845update()
API line up #7842findOneAndReplace()
sends replacement
to server #7654[]
as a value when casting $nin
#7806update()
by default #7801getPopulatedPaths()
return deeply populated paths #7757Model.findOneAndUpdate()
#7794remove()
on nested path #2398{new:false,upsert:true,rawResult:true}
#7774 #7770 LiaanMvalidators
option because it conflicts with Backbone #7720assert.deepEqual()
each other if they have the same values #7700distinct()
description #7767 phil-rvalidators
in schema types #7720replacement
parameter for findOneAndReplace()
#7654delete()
unset the key in the database #7746 Fonger_schema
property to avoid confusing deep equality checks #7700depopulate()
from removing fields with empty array #7741 #7740 FongerMongooseArray#includes
support ObjectIds #7732 #6354 hansemannn_parent
property behind a symbol #7726 #7700bulkWrite()
#7055eachAsync()
instead of nonexistent each()
#7699Model.init()
so deleteModel()
frees all memory #7682Document#populated()
work for populated subdocs #7685.set()
on document array underneath embedded discriminator path #7656{ unique: false, index: false }
#7620Aggregate#model()
with no arguments return the aggregation's model #7608match
#7397defineProperties()
in Buffer constructor #7331plugin()
for connection-scoped plugins #7378Query#distinct()
#5938getters
option to Document#get() #7233propsParameter
set on validator #7447save()
#7492 captaincaiusisAsync
option for custom validators #6700omitUndefined
option to docs for updateX() and findOneAndX() #3486Model.prototypedelete
link #7665 pixcai{...doc}
#7645lean()
#7640this
when overwriting single nested subdoc #7585new BaseModel()
with discriminator key #7586_id: false
#7524model()
function so code that uses model doesn't throw #7541 caubgetters
option handle nested paths #7521create()
and then set()
#7504util.inherits
like mongoose-float #7486false
schema paths #7516 #7512Query#merge()
#1790_id: false
in schema paths as a shortcut for setting the _id
option to false
#7480session
option to save()
#7484isPOJO()
function instead of constructor checks #7500remove()
, updateOne()
, and update()
use the document's associated session #7455toObject()
#7442populated()
when using virtual populate #7440{document, query}
options to Schema#pre(regex) and Schema#post(regex) #7423count()
deprecation #7419Document#populate()
#7302foreignField
with virtual populate #7374orFail()
#7409deleteOne()
, deleteMany()
, and remove()
contains #7324castNonArrays
option #7371save({ timestamps: false })
#7357Document#remove()
so we attach the shardKey #7393mongoose.connections
#7338count
option when using Document#populate()
on a virtual #7380valueOf()
#7353flattenMaps
option for toObject()
and toJSON()
at schema level #7274.where()
#7360.base
when cloning #7377save()
not crash if nested doc has a property 'get' #7316mongoose.model()
#5767populated
to reserved property names #7317mongoose.model()
returns the model #5767SchemaType.get()
, custom getters across all instances of a schematype #6912SchemaType.cast()
, configure casting for individual schematypes #7045SchemaType.checkRequired()
, configure what values pass required
check for a schematype #7186 #7150Model.findOneAndReplace()
#7162Model.events
emitter that emits all error
's that occur with a given model #7125count
option to populate virtuals, support returning # of populated docs instead of docs themselves #4469.catch()
helper to make aggregations full thenables #7267deleteOne()
and deleteMany()
#7195updateOne()
#7133Query#map()
for synchronously transforming results before post middleware runs #7142Schema
constructor #7218clone
option to ensure multiple docs don't share the same populated doc #3258Query#maxTimeMS()
helper #7254Aggregate#addCursorFlag()
#7120findOneAndDelete
to middleware list #7327 danielkesselberg__proto__
in queries #7290import mongoose, {Schema} from 'mongoose'
#5648orFail()
with findOneAndUpdate()
and findOneAndDelete()
#7297 #7280save()
succeed if strict: false with a collection
property #7276flattenMaps
option for toObject() #7274model
option overrides refPath
#7273null
projection param #7271openUri()
instead of legacy open()
#7277 artemjackson__parent
so user code doesn't conflict #7230mongoose.model()
without context, like import {model} from 'mongoose'
#3768ref
#7253ref
path in a schematype #7253splice()
#7249instanceof
rather than class name for comparison #7237 ivanseidelbulkWrite()
docs #7225checkKeys: false
#7144lean(false)
correctly with query cursors #7197ref
not set #7193.base
for browser build #7170.set()
underneath a single nested subdoc #7196propsParameter
set #7145type
getting converted to mixed #7143replaceOne()
always gets set at top level to prevent cast errors #7138eachAsync()
#7137$session()
propagate sessions to child docs #7104schema.options.strict = 'throw'
#7103add()
and remove()
return the schema instance #7131 lineuscast()
#7118useFindAndModify
as a connection-level option #7110 lineus$isValidatorError
property #7127remove()
#7093fields
param #7077members.host
errors due to bad host names in replica set #7006orFail()
#7101 #7099 gsandorx{ timestamps: false }
correctly #7088 #7074 lineusmongoose.connect()
errors with a callback #6997close()
function #7068 #7022 lineus_id
index is set to "hashed" #7053mongoose.set('debug', WritableStream)
so you can pipe debug to stderr, file, or network #7018createCollection()
helper to make transactions easier #6948 #6711 Fongerschema.add(otherSchema)
to merge hooks, virtuals, etc. #6897orFail()
helper that throws an error if no documents match filter
#6841now()
function that you can stub for testing timestamps #6728schema.pre(RegExp, fn)
and schema.post(RegExp, fn)
#6680mongooseOptions()
function #6677$set
#4412remove
hook and ability to switch between query remove
and document remove
middleware #3054select('+c')
if c is not in schema #7017localField: function() {}
syntax #5704save()
and add a workaround for findOneAndUpdate()
#7038createIndex
option to ensureIndexes()
#7036 #6922 lineussetUpdate()
to allow overwriting update without changing op #7024 #7012 lineus$
operators in the update #7003count()
supports that countDocuments()
doesn't #6911useCreateIndex
at the connection level, overrides global-level #6922ref
to an invalid value #6915model
instead of Model
so double-populating works with existing docs #6978Model.init()
again after calling dropDatabase()
#6967populate()
-ed fields to select()
#6546insertOne
and replaceOne
#5708validate()
a child doc #6931constructor
and prototype
if strict mode falseconstructor
and prototype
if strict mode falsethis
scope when casting query with legacy 2dsphere pairs defined in schema #6939 #6937 Fongerget()
on deeply nested subdocs #6929 #6925 jakemccloskeyjustOne
virtual populate underneath array #6867$set
#5973session
option for save()
as the document's $session()
#6909mongoose.set('useCreateIndex', true)
to avoid ensureIndex deprecation warning #6890projection
option to avoid deprecation warnings #6888 #6880 FongerfindOneAndReplace()
internally if using overwrite: true
with findOneAndUpdate()
#6888 Fongerprojection
instead of fields
internally for find()
and findOne()
to avoid deprecation warning #6880getters
option to opt in to calling getters on populate #6844this
scope of default functions for DocumentArray and Array #6868 #6840 FongergetQuery()
#6855 #6854family
option for IPv4 vs IPv6 and add port to example URIs #6784usePushEach
option for easier Mongoose 4.x + MongoDB 3.6 #6858execPopulate()
code example #6851 WJakubexecPopulate()
#6851objectIdGetter
option docs #6842 jwaltonrequired
function only gets called once when validating #6801useNewUrlParser: true
#6789options.match
in virtual populate schema definition #6787expireAfterSeconds
option when diffing indexes in syncIndexes() #6820 #6819 christopherhexdeleteMany
#6810 Fongerpopulate()
on already populated path #6798$inc: null
#6770createConnection(undefined)
#6763get()
#6779 #6637localField
specified catchable #6767mongoose.connect()
syntax #6756$session
in execPopulate()
#6754populate()
#6754session()
helper for consistency with query api #6752init()
as well as db.model() #6707convertToTrue
and convertToFalse
for custom boolean casting #6758isNew
and save
listeners on CastError because otherwise they never get removed #6723countDocuments()
vs estimatedDocumentCount()
#6713family
option for IPv4 vs IPv6 and add port to example URIs #6566new db.model(foo)(bar)
#6698session()
function to queries to avoid positional argument mistakes #6663writeConcern
option and writeConcern helpers #6620writeConcern
option and re-add description for safe
option #6620startSession()
helper to connection and mongoose global #6689properties.message
as well as message
#6621countDocuments()
#6643objectIdGetter
option to remove ObjectId.prototype._id #6588runValidators
as a global option #6578syncIndexes()
, drops indexes that aren't in schema #6281Query.prototype.set()
#5770setOptions()
lists #6624push()
on triple nested document array #6602modifiedPaths()
with includeChildren option #5904save()
returns undefined
if passed a callback #6604 lineusprojection
option to findOneAndUpdate()
#6590 lineuscreateModel
#6552 profbissapplyPluginsToDiscriminators
option #4965toString()
as custom method #6538lean()
down to subpopulate #6498 AbdelrahmanHafezdoc.set()
underneath embedded discriminator #6482useDb()
#6480emit()
in mapReduce and how map/reduce are run #6465refPath
#6457create()
with a non-existent discriminator key #6434retainNullValues
option to avoid stripping out null keys #6432_id
getter so you can get a usable id whether or not the path is populated #6415 #6115cloneSchemas
option to mongoose global to opt in to always cloning schemas before use #6274findOneAndDelete()
and findByIdAndDelete()
#6164$ignore()
on single nested and array subdocs #6152save()
on subdocs #6152save()
use updateOne()
instead of update()
#6031[]
as a value for $in
when casting #5913valueOf()
when casting to Decimal128 #6419 #6418 lineusmongoose.pluralize()
#6412 FastDeathnull
id #6406toHexString()
helper that was added in 5.0.15 #6359push()
on a nested doc array #6398insertMany()
#6381required: true
within documentarray definition #6364isNew
is set before default functions run on init #3793createCollection()
#6370 mattc41190numAffected
#6367 ekulabuhovminlength
and maxlength
docs #6365 treble-snake.select()
method #6346required
array with update validators and $pull #6341$set
#5973valueOf()
function to support Decimal.js #6306 #6299 lineustoHexString()
function so you don't need to check whether a path is populated to get an id #6115toJSON()
on a nested path #6294client.db()
syntax rather than double-parsing the URI #6292 #6286.hint()
to aggregate #6272 #6251 lineuscreate()
params show up correctly in docs #6242insertMany()
#6228updateOne()
and updateMany()
#6282 gualopezbignoreUndefined
option works #6236completeMany()
so it works with lean() #6234discriminators
property from base schema #6122 #6064emitIndexErrors
#6186 isaackwanuseDb()
#6036 rocketspacereach()
#6160 simlllluseFindAndModify
option on singleton #5616clone()
#6133enum
on arrays of strings #6102$addToSet: [1, 2]
-> $addToSet: { $each: [1, 2] }
#6086where()
overwriting primitive with object #6097resetId
setter on queries with _id #6093discriminators
property from base schema #6064valueOf()
when merging object for update #6059dbName
option to work around mongodb+srv
not supporting db name in URI #6106strictQuery
option #6032mongoose.model()
docs bryant1410useMongoClient
in 5.x #5961mongoose.model()
#5958.aggregate().cursor()
#5941emitIndexErrors
is on by default, failing index build will throw uncaught error if not handled #5910mongoose.pluralize()
function #5877passRawResult
option for findOneAndUpdate
, use rawResult
#5869_id
#5820 varunjayaramanmongoose.connect()
returns a promise, removed MongooseThenable #5796cursor()
instead #5795open()
and openSet()
removed, use openUri()
instead #5795$pushAll
, remove usePushEach
option #5670runSettersOnQuery
, always run setters on query #5340required: true
for arays #5139 wlingkesaveErrorIfNotFound
, always error out if save()
did not update a document #4973toObject()
and toJSON()
option parameter merges with defaults rather than overwriting #4131default
on _id
#4069deleteX()
and remove()
promise resolves to the write object result #4013update()
, updateX()
, replaceOne()
, remove()
, deleteX()
in exec #3529retainKeyOrder
, always use forward order when iterating through objects #2749aggregate()
no longer accepts a spread #2716reject(null)
with eachAsync callback #5875 #5874 ZacharyRSmithmongoose.connection
to invalid values #5871 jinasonlinreturn next()
to stop middleware execution #5866populate()
on nested document props #5703strictBool
option for schema type boolean #5344 #5211 #4245.pipeline()
helper to get the current pipeline #5825unique
FAQ #5823 mfluehrinsertMany()
if using ordered: false
and rawResult: true
#5337set
as a schema path #1939ensureIndex()
and use it by default #3280$in
and required for $pull and update validators #5744mongoose.Model()
over mongoose.model()
#2005autoIndex
as top-level option rather than requiring config.autoIndex
#5711discriminator()
function for single nested subdocs #5244init()
public and return a promise that resolves when indexes are done building #5563pull()
-ing a doc #3511.validate()
get copied with clone() #5607.set()
#5576id
property after schema was created #5570 #5548eachAsync()
#5486 lchenayselect: false
fields in schema #5448type: [Array]
in schemas #5416shared
specified #5407validateSync()
after overwriting doc array index #5389runSettersOnQuery
#5339useMongoClient
and openUri
functions, deprecate current connect logic #5304parseOption
mutates user passed option map #5357 igwejkmessage
shows up with JSON.stringify #5309getPromiseConstructor()
to prevent need for mongoose.Promise.ES6
#5305_id
is never null #5236unique: true
in arrays via the mongoose-unique-array plugin #3347parentArray
references when directly assigning document arrays #5192 jhob$
#5131 krmannixisAsync
with validate() #5125insertMany
validation errors #5072 sjorssnoerendepopulate()
#5027replaceOne()
, deleteOne()
, deleteMany()
#3998bulkWrite()
#3998loadClass()
function for importing schema from ES6 class #4668 rockmacacaensureIndex()
never calls back in the same tick #4246justOne
option for populate virtuals #4263onOpen
and onClose
#4259 nodkzassert.deepEqual()
a plain old JS array) #3886.near()
#4179createdAt
#4155destroy()
and close event #4126 AnthonyCCmongoose.connect()
#3874execPopulate()
in doc.populate()
docs #3836mongoose.plugin()
function #3732== null
as shorthand #3852.connect()
return value #3847text: true
as a way to declare a text index #3824Object.defineProperties()
for array #3799 TrejGuninsertMany()
for more performant bulk inserts #723_id=0
correctly #3776.connect()
callback #3705.sample()
helper #3665new
option and findByIdAndUpdate #3661.lookup()
helper #3532mongoose.set()
docs #3557findOne()
#3593 gunarisAsync
parameter to hooks #3573.toObject()
when setting a single nested doc #3535ms
package for security vulnerability #3524 fhembergerdontThrowCastError
option to .update() for promises #3512findByIdAndUpdate
#3380.pull()
on a documentarray without an id #3341schema.queue()
now public #3193match
validator undefinedisModified
a schema reserved keyword #2975setDefaultsOnInsert
without specifying runValidators
#2938kind
property #2885new
option to findAndModify ops is false by default #2262geoNear()
no longer enforces legacy coordinate pairs - supports GeoJSON #1987 alabiddoc.errors
now cleared before validate()
called #2302execPopulate()
function to make doc.populate()
compatible with promises #2317count()
no longer throws an error when used with sort()
#2374save()
no longer recursively calls save()
on populated fields #2418required
field #2247domain
to reserved keywords #1338 #2052 antoinepairetdoc.remove()
returns a promise #1619 refackdomain
to reserved keywords #2052 #1338npm
will shut up #1769 refackoverwrite
optionawaitdata
query optionminimize
and getters
options #1607 JedWatsonoverwrite
optionawaitdata
query optionsetMaxListeners
as pathmodel
as doc propertypath
as pathname #1245 daeq4216f14
collection
option docs hermanjungedoc.array.set(index, value)
read
schema option205a709c
f3a5bd3d
6924cbc2
]options
as a pathname (#529)model
is again a permitted schema path name1149804c
7cf8beec
throws
[regality]lean
query option [gitfy]safe
along to doc#remove() callssafe
option in all ensureIndex callsinstance.save()
(#691)model()
method within static methods1bee2a2
error
on connection when open fails [edwardhotchkiss]9782463fc
null
and undefined
are set atomically.undefined
.type
as a key.uri, db, fn
and uri, fn
signatures for replica sets.lowercase
, uppercase
, trim
.Model
, Document
) and tests.Document
s.id
virtual getter for documents to easily access the hexString of
the _id
.Document#toJSON
[dalejefferson]Connection
authentication [robrighter]Model#save
promise handlingpost
middlewareMongooseNumber
, works almost like the native except for typeof
not being 'number'
.