title: Meteor: How should I update the Users collection to include a new attribute in the object / dictionary?
body: <p>I've tried looking for an answer all over but cannot seem to get this working. I'm using Meteor with Cordova to build a mobile app. </p>
  
  <p>I want to add an attribute to my Users collection (the one Meteor creates when I'm logged in). ie. For example, I want to add {currentHotel: "Something"} to my db.Users collection.</p>
  
  <p>I'm trying to do this the correct, Publish - Subscribe way. Using Meteor.methods has been quoted to not be good for real - time applications. Either way, I want to understand how to update the Users collection using Publish - Subscribe.</p>
  
  <pre><code>//On the server, I did
  Meteor.publish("userData", function () {
      return Meteor.users.find({_id: this.userId},
         {fields:{services: 1, currentHotel: 1}});
  });
  </code></pre>
  
  <p>So the currentHotel field should be accessible to the client side. Now to update the "currentHotel" field:</p>
  
  <pre><code>//On the client I do
  Meteor.subscribe('userData');
  var user = Meteor.users.findOne({"_id": Meteor.userId()});
  Meteor.users.update({_id: user._id}, {$set:{currentHotel:'something'}});
  
  //I tried this too
  //Meteor.users.update({ _id: Meteor.userId() }, {$set: });
  </code></pre>
  
  <p>On the browser console I can see "currentHotel" and "services" just fine, which means the publish-subscribe worked. Yet I cannot seem to update the currentHotel. I get an Access Denied. Why is this?</p>
  
  <p>Additionally, If the "currentHotel" property did not exist in the Collection at all, how can I add it using a similar publish-subscribe? Can I publish a property that isn't there and allow the client to subscribe and add that property?</p>
  
  <p>I referred to the Meteor docs, <a href="https://stackoverflow.com/questions/25198683/subscribing-to-meteor-users-collection">this</a>, <a href="https://stackoverflow.com/questions/18367644/proper-way-to-add-field-to-the-user-collection-in-meteor">this</a> and <a href="https://stackoverflow.com/questions/20630829/meteor-pass-data-from-client-to-server">this</a>, but still cannot seem to get it to work! :-(</p>
  
  <p>Thanks in advance!</p>