Mysql can update the field with the new value and the exist value when the row exist like this,
insert into table (col1, col2)
values (value1, value2)
on duplicate key update
col1 = col1 + values(col1);
Is mongodb has the equivalent way?
I just know the upsert option, which can only set the new value to the exist one. How to use the new value and exist value at the same time?