gpt4 book ai didi

meteor - 更新 meteor 中的用户个人资料详细信息不起作用

转载 作者:行者123 更新时间:2023-12-04 03:37:42 27 4
gpt4 key购买 nike

我如何在 meteor 应用程序中编辑用户集中的用户详细信息,我的代码是

 Meteor.users.update({_id:this._id}, { $set:{"profile.name":pname}} )

这仅适用于列表中的第一个用户。如何为列出的所有用户执行此操作?

最佳答案

我发现更新 meteor 用户的唯一方法是使用带有Meteor.userId()的_id设置条件:

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

我在服务器端执行此操作,因此它将阻止客户端,直到Mongo成功/失败为止。

关于meteor - 更新 meteor 中的用户个人资料详细信息不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22318623/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com