MukulAgr
MukulAgr

Reputation: 291

mongoDB query has got error

I have written a query in mongoDB and got an error. Please some one help me in resolving it Query is:

> db.Accounts.update(_id:t.source,pendingTransaction:{$ne:t._id}},{$inc:{balance
:-t.value},$push:{pendingTransactions:t._id}});

ERROR IS:

2014-10-10T20:27:02.861+0530 SyntaxError: Unexpected token :

Upvotes: 0

Views: 31

Answers (1)

Birgit Martinelle
Birgit Martinelle

Reputation: 1889

db.Accounts.update({ the { is missing ...

db.Accounts.update({
 _id:t.source,
  pendingTransaction:{$ne:t._id}},
{$inc:{balance
:-t.value},$push:{pendingTransactions:t._id}});

Upvotes: 2

Related Questions