$set
The $set operation is used to update or assign a specific field in a document with a new value. If the field does not exist, it creates the field and sets the given value. This operation is commonly used for modifying existing records, updating nested objects, and ensuring that certain fields always contain the latest data. It is useful for direct modifications without affecting other fields in the document.
Last updated