mongoose 使用bulkWrite 提示TypeError: Update document requires atomic operators:
operators like: [
{updateOne: {filter: {_id: ObjectId("57ab909791c3b3a393e9e277")}, update: { 'tag.value': 2, 'tag.key': 'update' }]}},
{updateMany: {filter: {tag: {$exists: false}}, update: { 'tag.value': 1 }}}
]
更新操作语句没有问题,问题在于mongoose schema中未定义tag字段。