[英]How should I update user.profile on subsequent login (something similar to Accounts.onCreateUser)?
[英]How to update the current user (Accounts)
我正在使用Accounts
( accounts-hithub
)。 現在一切正常,但現在我想更新當前用戶。
我已經嘗試過類似的事情
Accounts.update({_id: Meteor.user()._id}, {...});
出現錯誤,帳戶沒有方法update
因此我嘗試創建一個用戶集合
Users = new Meteor.Collection('users');
這也是不允許的,它給我以下錯誤:
Error: A method named '/users/insert' is already defined
那么,如何更新當前用戶呢?
用戶詳細信息位於Meteor.users
集合中。 因此,您可以使用Meteor.users.update()
( http://docs.meteor.com/#meteor_users )編輯用戶詳細信息。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.