mongodb - mongo - $inc incrementing by 2 instead of 1 using meteor methods -
meteor method:-
incrementcount: function(toperson){ meteor.users.update({'emails.0.address': toperson}, {$inc: {'profile.notificationcount': 1}}); }
meteor method call:-
meteor.call("incrementcount", message.to);
the issue on first load notificationcount increments 2, loads afterwards increment accurately 1.
i have searched docs mongodb solutions did not have success.
thank in advance responses.
Comments
Post a Comment