Meteor - 更新回调内的用户配置文件

时间:2017-09-12 00:16:20

标签: meteor meteor-accounts

我正在尝试更新回调中的用户个人资料,但我不断遇到同样的错误。已经尝试了多种方法..任何帮助都会很棒。谢谢!

  

异步函数回调中的异常:错误:无效的修饰符。   修饰符必须是对象。

        let user = Meteor.users.findOne({"profile.wallets.address": d.Address});
        let wallets = user.profile.wallets;
        wallets[0].amount = d.Amount;

        Meteor.users.update(user._id, {$set: {'profile.wallets': wallets}});

1 个答案:

答案 0 :(得分:1)

您是否尝试过这样做:

let profile = user.profile
profile.wallets = wallets
Meteor.users.update(user._id, {$set: {profile: profile}})

因为修饰符可能不是虚线路径

相关问题