In Meteor 0.5.8 the following change was introduced:
Calls to the update and remove collection functions in untrusted code
may no longer use arbitrary selectors. You must specify a single
document ID when invoking these functions from the client (other than
in a method stub).
So now if you want to push arbitrary updates to the db from the client console, you have to do something like:
People.update({_id:People.findOne({name:'Bob'})['_id']}, {$set:{lastName:'Johns'}});
Instead of:
People.update({name:'Bob'}, {$set:{lastName:'Johns'}});
I thought that this security issue controlled by setting the Meteor.Collection.allow and .deny functions in conjunction with the autopublish and insecure packages. I liked being able to interact with the db from the Chrome JavaScript Console.
What is the motivation for the changes in Meteor 0.5.8?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…