Questions about users collection


#1

Hi,
i’m trying to find a way for update a field for all my users in a method.
Is there any solution for do it ?

Thanks.


#2

Yes, you could use the MongoDB $set-Operator along with the multi-Operator http://docs.mongodb.org/manual/reference/method/db.collection.update/#multi-parameter


#3
Meteor.users.update({}, {
  $set: { attribute: 'some_value' }
}, { multi: true });