When I try to add a field to an object, instead of adding the field to the object it deletes all of the previous fields and adds the new field.
data.collection.updateOne({},{$set: {"object": {"hi":0}}},true)
What I want:
object: {
hello: 0,
hi: 0,
}
What I get:
object: {
hi: 0,
}
I tried everything I could but I did not get it to work as I wanted it to.