user1 in database
{
counts: [{code:"aaa", num:100}, {code:"bbb", num:200}]
}
counts
is an Array, it has two elements code
and num
.
How to let num
increase 1 if code = "aaa"
?
Meteor.users.update(user1._id, {$inc: {???}}); // How to write this?
Thanks