我想借助变量更新数组,这就是我的源代码:
var y = Flags.findOne({_id: "flagsone"});
// This one works, but I need the other one
// Books.update({_id:book}, {$set: {"score20130901.5": 222}});
Books.update({_id:book}, {$set: {"score20130901.[y.flag1]": 222}});
有人知道,我如何将变量放在一起?