I currently have the following query:
Meteor.users.update({energy: {$lt: 30}}, {$inc: {"energy": 1}}, {multi: true});
But I want to do the following:
Meteor.users.update({energy: {$lt: maxenergy}}, {$inc: {"energy": 1}}, {{multi: true});
Where maxenergy is another field in the document, is this possible or do I need to loop over the entire collection to do this?
Any help would be appreciated.