The dollar ($) prefixed field '$inc' in '$inc' is not valid for storage
findAndModify的一个更新db.getCollection('cuishou_ids').findAndModify({ 'query':{ 'name':'user' }, 'update':{ $set:{$inc:{'id':1}} }, 'new':true
·
findAndModify的一个更新
db.getCollection('cuishou_ids').findAndModify({
'query':{
'name':'user'
},
'update':{
$set:{$inc:{'id':1}}
},
'new':true,
// 'upsert':true
})
问题的原因是:
$set 和$inc不可以同时存在
更多推荐
所有评论(0)