-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 3.0.7
-
Component/s: Native
-
Empty show more show less
Hello,
The methode findOneAndUpdate with a empty update field $unset all the field. :
collection.findOneAndUpdate({ _id: new ObjectID(id) }, {}, { upsert: false })
I know that if empty i should prefer use only the findOne method but it seems dangerous to unset all if empty in this method. and i need to use it like this. Expect to do nothing if empty.
Dor now i make the trick to protect against the $unset all with :
collection.findOneAndUpdate({ _id: new ObjectID(channelId) }, { $setOnInsert:
}, { upsert: false })
Can you update this rules?