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

    XMLWordPrintable

Details

    • Task
    • Status: Closed
    • Minor - P4
    • Resolution: Done
    • None
    • 5.0.0
    • manual, Server
    • None

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:
                42 weeks, 5 days ago