我在mongoDB中编写了一个查询并收到错误。请有人帮我解决 查询是:
> db.Accounts.update(_id:t.source,pendingTransaction:{$ne:t._id}},{$inc:{balance
:-t.value},$push:{pendingTransactions:t._id}});
错误是:
2014-10-10T20:27:02.861+0530 SyntaxError: Unexpected token :
答案 0 :(得分:2)
db.Accounts.update( { {is missing ...
db.Accounts.update({
_id:t.source,
pendingTransaction:{$ne:t._id}},
{$inc:{balance
:-t.value},$push:{pendingTransactions:t._id}});