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

Document $expr not supported with upsert

    XMLWordPrintableJSON

Details

    Description

      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.)

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:
              2 years, 25 weeks, 2 days ago