How can I edit the user details in users collection in my meteor app.My code is
Meteor.users.update({_id:this._id}, { $set:{"profile.name":pname}} )
This is working only for the 1st user in the list. How can I do this for all users listed ?
I found that the only way to update a Meteor user was to set the criteria using the _id with the Meteor.userId()
:
Meteor.users.update( { _id: Meteor.userId() }, { $set: { 'oauth.token': token }} );
I do this on the server side so it will block the client until success/failure from Mongo.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With