0
What is the behavior when Mongo reaches its maximum value for findAndModify with parameters below, how can I restart to 0 when this happens?
db.collection('count').findAndModify(
{ "_id": "xy" },
[["_id", 1]],
{ $inc: { seq: 1 } },
{new: true, 'upsert': true},
function(err,doc) {
if (err) throw err;
console.log(doc.value.seq);
}
Welcome to Stack Overflow in English. This Question appears to be in English and this is the SO Portuguese community. If you’re Looking to get help in English, Please visit - Stack Overflow in English If you’re Looking to get help in English, Please Edit and Translate your Question.
– Chun
Don’t forget to [Dit] the title.
– gmsantos