Grokking MongoDB
0% completed
More Field Update Operators
What if an update should write a value only when it is lower than the current one, or only when the document is new? Five more field update operators handle cases like these, where the change depends on the field's name, its current value, the clock, or whether the update inserts a document.
| Operator | What it does to the field |
|---|---|
$rename | Changes its name |
$min | Writes the value only if the value is lower than the current one |
$max | Writes the value only if the value is higher than the current one |
| `$currentDate |
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%