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

IndexCatalog should forbid creation of index with multiple special types

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.6.0-rc2
    • Fix Version/s: 2.6.0-rc3
    • Component/s: Index Maintenance
    • Labels:
      None
    • Operating System:
      ALL

      Description

      It is possible to make a compound index in which the first field is "2d" and the second is "text":

      > db.coll.ensureIndex({a: "2d", b: "text"})
      {
      	"createdCollectionAutomatically" : true,
      	"numIndexesBefore" : 1,
      	"numIndexesAfter" : 2,
      	"ok" : 1
      }

      Other special index types disallow this, for example "2dsphere":

      > db.coll.ensureIndex({a: "2dsphere", b: "text"})
      {
      	"createdCollectionAutomatically" : true,
      	"numIndexesBefore" : 1,
      	"errmsg" : "exception: Cannot use 2dsphere index with other special index types: b: \"text\"",
      	"code" : 16823,
      	"ok" : 0
      }

      We may want to do the same validation for "2d" that we do for "2dsphere".

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              rassi J Rassi
              Reporter:
              david.storch David Storch
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: