user6215342
user6215342

Reputation:

Meteor (JavaScript App Platform) | Adding Data to User Accounts

After successfully adding the "account-ui" & "accounts-password" packages using the METEOR platform, I encountered difficulties in attempting to implement the todo app.

How do I add user data?

More specifically:

Upvotes: 0

Views: 49

Answers (1)

aedm
aedm

Reputation: 6564

Generally, I would try to avoid updating the 'users' collection frequently, so I'd store that information in a separate collection. But since this is not what you asked, here's how you store a default value in a user document.

Accounts.onCreateUser(function (options, user) {
  user.profile = {points: 0};
  return user;
});

http://docs.meteor.com/#/full/accounts_oncreateuser

Upvotes: 1

Related Questions