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

Unable to create 2d index on collection with non-simple default collation

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.3.11
    • Affects Version/s: 3.3.8
    • Component/s: Querying
    • None
    • Fully Compatible
    • ALL
    • Hide
      db.mycoll.drop();
      assert.commandWorked(db.runCommand({create: "mycoll", collation: {locale: "en"}}));
      assert.commandWorked(db.mycoll.createIndex({a: "2d"}, {collation: {locale: "simple"}}));
      
      Output
      {
        "ok" : 0,
        "errmsg" : "\"collation\" not supported for index type 2d",
        "code" : 67
      }
      
      Show
      db.mycoll.drop(); assert.commandWorked(db.runCommand({create: "mycoll" , collation: {locale: "en" }})); assert.commandWorked(db.mycoll.createIndex({a: "2d" }, {collation: {locale: "simple" }})); Output { "ok" : 0, "errmsg" : "\"collation\" not supported for index type 2d", "code" : 67 }
    • Query 18 (08/05/16)

      This affects all other index types that don't support non-simple collations. The issue is that the index build request inherits the collection's default collation, but IndexCatalog::_isSpecOk() prevents the index type from having a "collation" element specified, even if its locale is "simple".

            Assignee:
            david.storch@mongodb.com David Storch
            Reporter:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: