Replies: 1 comment
-
You would do |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
A created this schema
Schema({ test: Object }, {minimize: false});
and when I findOneAndUpdate the fields are always reset rather than added.
await model.findOneAndUpdate({}, {$set: {test: { cat: "mew!" }}}, {new: true}) //show -> cat
await model.findOneAndUpdate({}, {$set: {test: { dog: "bau!" }}}, {new: true}) //show only -> dog (the cat should also show)
Beta Was this translation helpful? Give feedback.
All reactions