if ture, includes meta data for the result from the MongoDB driver
Optionallean
lean?:boolean | Record<string, any>
If truthy, mongoose will return the document as a plain JavaScript object rather than a mongoose document.
Optionallimit
limit?:number
OptionalmaxTimeMS
maxTimeMS?:number
Optionalmulti
multi?:boolean
OptionalmultipleCastError
multipleCastError?:boolean
Optionalnew
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.
Set to true to automatically sanitize potentially unsafe query filters by stripping out query selectors that
aren't explicitly allowed using mongoose.trusted().
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.
OptionaltranslateAliases
translateAliases?:boolean
If true, convert any aliases in filter, projection, update, and distinct
to their database property names. Defaults to false.
if ture, includes meta data for the result from the MongoDB driver