The dollar ($) prefixed field '$inc' in '$inc' is not valid for storage

xiaoxiao2021-02-28  57

findAndModify的一个更新

db.getCollection('cuishou_ids').findAndModify({     'query':{         'name':'user'         },       'update':{           $set:{$inc:{'id':1}}           },        'new':true, //        'upsert':true     })

问题的原因是:

$set 和$inc不可以同时存在

转载请注明原文地址: https://www.6miu.com/read-34719.html

最新回复(0)