mongodb obtained from increasing the number of

 

mongodb db.getCollection('user').findAndModify({update:{$inc:{'level':1}},query:{"name":"hello"}});

                Or like this:   

      db.ids  .findAndModify({update:{$inc:{'id':1}}, query:{"name":"user"}, new:true});

Guess you like

Origin www.cnblogs.com/focusHots/p/11596409.html