I use the following code to add some content to an array and increment two different counters.
The item is correctly placed in the array, and pendingSize is correctly incremented. But unRead never increases. It was used to increase, and today it has ceased. The value of the unRead field in my mongodb collection (hosted on mongohq) is set to 0 (numeric, not string)
When I look at my console, I see "update success."
any clue why it stopped working?
thanks
Notifications.update({ "id" : theid}, { $push: { pending: notification}, $inc: { unRead : 1 }, $inc: { pendingSize: 1 }}, function(err){ if(err){ console.log('update failed'); callback("Error in pushing." + result.members[i]); } else{ console.log('update succes'); callback("Success"); } });
source share