$clear
The $clear operation is used to remove all values from a field, effectively resetting it. This operation clears the contents of arrays, objects, or other data types in the specified field without deleting the field itself. It’s useful for situations where you need to clear the data but maintain the structure of the field for future updates.
Last updated