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

IndexCatalog should forbid creation of index with multiple special types

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 2.6.0-rc2
    • 2.6.0-rc3
    • Index Maintenance
    • None
    • 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

              rassi J Rassi
              david.storch@mongodb.com David Storch
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: