Meteor - 在回调中更新用户配置文件
Meteor - Updating user profile inside callback
我正在尝试在回调中更新用户配置文件,但我总是遇到同样的错误。已经尝试了多种方法。任何帮助都会很棒。谢谢!
Exception in callback of async function: Error: Invalid modifier.
Modifier must be an object.
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}});
你试过这样做吗:
let profile = user.profile
profile.wallets = wallets
Meteor.users.update(user._id, {$set: {profile: profile}})
因为修饰符可能不能是虚线路径
我正在尝试在回调中更新用户配置文件,但我总是遇到同样的错误。已经尝试了多种方法。任何帮助都会很棒。谢谢!
Exception in callback of async function: Error: Invalid modifier. Modifier must be an object.
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}});
你试过这样做吗:
let profile = user.profile
profile.wallets = wallets
Meteor.users.update(user._id, {$set: {profile: profile}})
因为修饰符可能不能是虚线路径