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

Document $expr not supported with upsert

    XMLWordPrintable

    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

            Assignee:
            ian.fogelman Ian Fogelman
            Reporter:
            renato.riccio Renato Riccio
            Participants:
            Last commenter:
            Ian Fogelman Ian Fogelman
            Docs Reviewer:
            Naomi Pentrel Naomi Pentrel
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Days since reply:
              26 weeks, 3 days ago
              Date of 1st Reply: