Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-66563

prepareUnique: true should not change the index spec when the index is already unique

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 6.1.0-rc0
    • None
    • None
    • None
    • Fully Compatible
    • Execution Team 2022-06-13

    Description

      Currently if you call prepareUnique: true on a unique index, the index spec will still be changed, which is kind of confusing:

      {
      		"v" : 2,
      		"key" : {
      			"a" : 1
      		},
      		"name" : "a_unique",
      		"unique" : true,
      		"prepareUnique" : true
      } 

      It seems prepareUnique: true should just be a noop on a unique index, and not change the index spec.

      Attachments

        Activity

          People

            yuhong.zhang@mongodb.com Yuhong Zhang
            wenbin.zhu@mongodb.com Wenbin Zhu
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: