我有以下数据结构:
{
answers: [
{
text: 'text',
owner: 'owner',
timestamp: timestamp,
comments: [
{
text: 'text',
timestamp: timestamp,
owner: 'owner'
}
]
}
]
}
这是我的update-command:
return Questions.update({
_id: id,
'answers.timestamp': answerTimestamp,
'answers.comments.timestamp': commentTimestamp,
'answers.comments.owner': this.userId
}, {
$set: {
'answers.$.comments.$.text': text
}
});
......这是错误:
Cannot apply the positional operator without a corresponding query field containing an array.
代码在服务器端运行!有人可以帮忙吗?