Updating the path 'x' would create a conflict at 'x'
问题 This error happens when I tried to update upsert item: Updating the path 'x' would create a conflict at 'x' 回答1: Field should appear either in $set , or in $setOnInsert . Not in both. 回答2: If you pass the same key in $set and in $unset when updating an item, you will get that error. For example: const body = { _id: '47b82d36f33ad21b90' name: 'John', lastName: 'Smith' } MyModel.findByIdAndUpdate(body._id, { $set: body, $unset: {name: 1}}) // Updating the path 'name' would create a conflict at