Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-14158

Document $expr not supported with upsert

      Description

      $expr is not supported in update query when upsert is used. This should be documented.

      MongoDB Enterprise > db.foo.update({$expr: {$eq: ["$a","$b"]}}, {$set: {c:1}},{upsert:true})
      WriteResult({
      	"nMatched" : 0,
      	"nUpserted" : 0,
      	"nModified" : 0,
      	"writeError" : {
      		"code" : 224,
      		"errmsg" : "$expr is not allowed in the query predicate for an upsert"
      	}
      })
      

      Scope of changes

      Impact to Other Docs

      MVP (Work and Date)

      Resources (Scope or Design Docs, Invision, etc.)

            Assignee:
            ian.fogelman@mongodb.com Ian Fogelman
            Reporter:
            renato.riccio@mongodb.com Renato Riccio
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              2 years, 36 weeks, 1 day ago