I have a short piece of code, like so, to update the name in my user's profile:
Meteor.users.update({_id: Meteor.userId()}, {$set:{"profile.name": name}});
When I'm working locally, I can use Meteor.userId
or Meteor.userId()
without issue. However, when I deploy to Modulus, I run into issues. If I don't have the operator on it, it will do the initial $set, but no more. If I user the operators, it behaves as I would expect.
Why is this? I assume that I shouldn't have been using this without the operator to begin with, but is there a reason why it worked at all?
Have a look in the documentation
The function Meteor.userId()
is available "Anywhere but publish functions"
The variable this.userId
is available "Anywhere" (which explicitly is also called out for the Server side Publish function).