Whenever I attempt to insert a new field into an object, it seems to overwrite all existing fields with the new one instead of simply adding it.
data.collection.updateOne({},{$set: {"object": {"hi":0}}},true)
My Desired Outcome:
object: {
hello: 0,
hi: 0,
}
The Result I'm Getting:
object: {
hi: 0,
}
Despite my best efforts, I haven't been able to achieve the desired functionality.