Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

strictPopulate

// In Mongoose 6, equivalent to `findOneAndUpdate({}, {}, { new: true })` because Mongoose will
// remove `name: undefined`
const res = await Test.findOneAndUpdate({}, { $set: { name: undefined } }, { new: true });
Source by mongoosejs.com #
 
PREVIOUS NEXT
Tagged: #strictPopulate
ADD COMMENT
Topic
Name
7+6 =