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

When specifying the "on" field when using $merge, clarify that fields that use a partial index with a unique constraint aren't allowed

      Currently, when we specify the "on" field using a field that is partially indexed with a unique constraint, we throw an error informing the user that an index isn't found.

      Error: command failed: {
      	"ok" : 0,
      	"errmsg" : "Cannot find index to verify that join fields will be unique",
      	"code" : 51183,
      	"codeName" : "Location51183"
      } : aggregate failed :
      

      Our source indicates that a field that is partially uniquely indexed is insufficient as a unique index.

      It's not clear in our $merge documentation that a partially indexed field is insufficient for specifying "on" in $merge.

            Assignee:
            naomi.pentrel@mongodb.com Naomi Pentrel (Inactive)
            Reporter:
            edwin.zhou@mongodb.com Edwin Zhou
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

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