If truthy, mongoose will return the document as a plain JavaScript object rather than a mongoose document.
Optional limit
limit?:number
Optional maxTimeMS
maxTimeMS?:number
Optional maxscan
maxscan?:number
Optional multi
multi?:boolean
Optional multipleCastError
multipleCastError?:boolean
Optional new
new?:boolean
By default, findOneAndUpdate() returns the document as it was beforeupdate was applied. If you set new: true, findOneAndUpdate() will
instead give you the object after update was applied.
if true, returns the raw result from the MongoDB driver
Optional readPreference
readPreference?:string
Optional returnOriginal
returnOriginal?:boolean
An alias for the new option. returnOriginal: false is equivalent to new: true.
Optional returnDocument
returnDocument?:string
Another alias for the new option. returnOriginal is deprecated so this should be used.
Optional runValidators
runValidators?:boolean
Optional sanitizeProjection
sanitizeProjection?:boolean
Optional sanitizeFilter
sanitizeFilter?:boolean
Set to true to automatically sanitize potentially unsafe query filters by stripping out query selectors that
aren't explicitly allowed using mongoose.trusted().
Optional setDefaultsOnInsert
setDefaultsOnInsert?:boolean
Optional skip
skip?:number
Optional snapshot
snapshot?:any
Optional sort
sort?:any
Optional strict
strict?:string | boolean
overwrites the schema's strict mode option
Optional strictQuery
strictQuery?:boolean | "throw"
equal to strict by default, may be false, true, or 'throw'. Sets the default
strictQuery mode for schemas.
If set to false and schema-level timestamps are enabled,
skip timestamps for this update. Note that this allows you to overwrite
timestamps. Does nothing if schema-level timestamps are not set.
If truthy, mongoose will return the document as a plain JavaScript object rather than a mongoose document.