Arithmetic operation during update/upsert

(Yashodhara) #1


I have a scenario where in I want to update a document however while I am updating i want to also do an arithmetic (sum) operation on the existing field value, for example - if a existing field x = 10 then while update the new x = 5 then i need my document to add these two as x = 10+5 = 15.

Please let me know if this is possible.



(Christian Dahlqvist) #2

this should be possible through scripted updates.

(system) #3

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.