When working on MySQL, I can setup an UPDATE based on the current value of the field as such:
UPDATE table SET field = field + 1;
Or
UPDATE table SET field = IF(field == 1, 0, 1);
I'm trying to figure out how I can do something similar in Mongo. If I want to do something like an if or trinary operator, can I do that in Mongo?