sourceplaze
sourceplaze

Reputation: 333

Meteor.users additional fields

How can I add new field to the current logged in user in document using 'Meteor.user()'?

NOTE: I am using meteoris packages to create and manage my users

Upvotes: 0

Views: 65

Answers (1)

DominicanCoder
DominicanCoder

Reputation: 365

you can use

 Meteor.users.update({ _id: Meteor.userId() },{ $set: { 'propertyHere': valueOfPropertyHere } });

Note: If you are updating the user from the client you need to make sure you have the correct permissions, also the Meteor.userId() would work.

If you are doing it from the server then change the Meteor.userId() to this.userId .. tested on Meteor 1.6

Upvotes: 1

Related Questions