Meteor JS, allow update -
I'm trying to update the Mongo record and am getting the error "Unwanted error: Not allowed. Untrusted The code can only update the documents by id. [403] "
This is an example of code
.toActive ': function () { // ... var teamId = session.get ('teamId'); console.log (teamId); Teams.update ({_ ID: Team ID, "player.id": this.id}, {$ set: {"players. $ Status": "active"}}); } Teams.allow ({update: function (userId, doc, fields, modifier) {// ... true true;}}) What should I do in this case ?
I think you only have trouble updating by _id.
Teams.update ({_ ID: TeamID}, {your updates}); Instead of }}); You are updating your subdocumented way differently how to manage it.
Comments
Post a Comment