I have 1000 users in my mongo db collections, i want to do some updating on them without loading them into the memory, the updating are those:
In every user Object i have the following:
user : {
money : 100,
skill : 50,
stamina : 50
}
I want to do the following simple operations:
user.skill = Math.max(0, user.skill + 50);
user.stamina = Math.max(0,Math.min(100, user.stamina + 20));
user.moral = Math.max(0,Math.min(100, user.moral + 10));
But again, an update like but not to store them in memory, is it even possible doing those kind of checks? (maybe more complicated things?)