Suppose there is such a set of data
{
"name": "Lucy",
"score": 40
}
I knowupdate
Yes$inc
To achieve accumulation, but what if what I need here is not addition but multiplication?
For example, I would like to put thescore
How can this be achieved?
Of course, I can do two inquiries, the first to obtain the current value, the second to modify, but this workload has doubled.
So, can I do the data according to the current results of the query?AtomWhat about updates?
Use
$mul
.