I am facing an issue similar to this:
I am struggling to modify multiple documents simultaneously.
click: function() {
var power = Meteor.user().power;
var mult = Meteor.user().mult;
Meteor.users.update({
_id: this.userId
}, {
$inc: {
'money': power * mult,
'lifetimeclick': 1,
'done': 0,
'done2': 0,
'done3': 0,
},
How can I adjust the code to update a variable in another document at the same time? Let me know if you need to see additional code snippets or if anything is unclear.
I would like the button click to increment variables for the current user and another user that has already been created.
I have attempted various approaches, but I do not understand the correct format to utilize or the process for achieving this.
The goal is to create a function that extracts a variable from one document and adds it to a variable in another document. Currently, my understanding is limited to updating variables in a single document only.