mongodb - Update document in Meteor allow function -


My messages are archive and I have removed unsafe package I want to insert new document in the archive. Is it possible to update existing documents before convergence?

This is an example that definitely does not work:

  messages. Empty ({insert: function (userID, doc) {If (userID == doc.userID) {// Something like this doctor = {email: Meteor.user (). Email [0] .address, message: doc. Message, time: date.now ()} back true;} and {return false;}}});  

As you can see that I am receiving just doc.message from the customer but I want to save the time and the user's email in the document. How can I do this in the meteor? What methods are the only options?

You can do this but you have to use to reject because Do not guarantee to run a given permission Try it one:

  post.dani ({insert: function (UserId, doc) {if (userId === doc.userID) {_.defaults (doc, {email: Meteor.user (). Email [0]. Transmission, time: date.Nan ()});} Return false;}});  

Take a look for the full details.


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -