and delete foo, updateOneDoc will create a mongo ops which $unset: {"foo.bar": 1} leaving me with a document that looks like
{
foo: {}
}
Conversely, if I attempt to set foo to null, updateOneDoc will create mongo ops which attempt to $set: {foo: null}and$unset: {"foo.bar": 1} resulting in a have conflicting mods in update error from Mongo.
If I have a document thus:
and delete foo, updateOneDoc will create a mongo ops which
$unset: {"foo.bar": 1}
leaving me with a document that looks likeConversely, if I attempt to set foo to null, updateOneDoc will create mongo ops which attempt to
$set: {foo: null}
and$unset: {"foo.bar": 1}
resulting in ahave conflicting mods in update
error from Mongo.