mongodbupsert

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'

Solution

  • Field should appear either in $set, or in $setOnInsert. Not in both.