I have a Mongo collection and in that let’s say a document has 10 fields. I am using upsert to update the collection. The issue is that in the update clause, if I am including 5 fields then remaining 5 fields (if the record exists already) are getting removed (since it is assumed to be null).
Do I need to provide all the fields in the update query?
Please let me know if you need additional details