[SERVER-13383] IndexCatalog should forbid creation of index with multiple special types Created: 27/Mar/14  Updated: 11/Jul/16  Resolved: 27/Mar/14

Status: Closed
Project: Core Server
Component/s: Index Maintenance
Affects Version/s: 2.6.0-rc2
Fix Version/s: 2.6.0-rc3

Type: Bug Priority: Major - P3
Reporter: David Storch Assignee: J Rassi
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-12538 Possible to create indexes with inval... Closed
Operating System: ALL
Participants:

 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".



 Comments   
Comment by Githook User [ 02/Apr/14 ]

Author:

{u'username': u'monkey101', u'name': u'Dan Pasette', u'email': u'dan@10gen.com'}

Message: Revert "SERVER-13383 validateKeyPattern allow only numeric/string key types"

This reverts commit b48e15efdd02c3217356484ad462dcde9d57920d.
Branch: v2.6
https://github.com/mongodb/mongo/commit/4bed1574b0179b54c0c49878638bfce210d91107

Comment by Githook User [ 02/Apr/14 ]

Author:

{u'username': u'monkey101', u'name': u'Dan Pasette', u'email': u'dan@10gen.com'}

Message: Revert "SERVER-13383 validateKeyPattern allow only numeric/string key types"

This reverts commit be9cd7b940531fe8a46e669155c81ca14e5189b0.
Branch: master
https://github.com/mongodb/mongo/commit/7a0fbca5a8dad17dcfb16ac4f9aec0d3ea4a64d8

Comment by Daniel Pasette (Inactive) [ 02/Apr/14 ]

reverting the change to restrict keyPattern to number/string.

Comment by Githook User [ 27/Mar/14 ]

Author:

{u'username': u'jrassi', u'name': u'Jason Rassi', u'email': u'rassi@10gen.com'}

Message: SERVER-13383 validateKeyPattern reject patterns w/ multiple plugins
Branch: master
https://github.com/mongodb/mongo/commit/04eda9bb1b5a348201f0b81d56af950c1c538a09

Comment by Githook User [ 27/Mar/14 ]

Author:

{u'username': u'jrassi', u'name': u'Jason Rassi', u'email': u'rassi@10gen.com'}

Message: SERVER-13383 validateKeyPattern reject patterns w/ multiple plugins

(cherry picked from commit 04eda9bb1b5a348201f0b81d56af950c1c538a09)
Branch: v2.6
https://github.com/mongodb/mongo/commit/dbb698b61a244e66897e6aaa4cfed858da6c378c

Comment by Githook User [ 27/Mar/14 ]

Author:

{u'username': u'jrassi', u'name': u'Jason Rassi', u'email': u'rassi@10gen.com'}

Message: SERVER-13383 validateKeyPattern allow only numeric/string key types
Branch: master
https://github.com/mongodb/mongo/commit/be9cd7b940531fe8a46e669155c81ca14e5189b0

Comment by Githook User [ 27/Mar/14 ]

Author:

{u'username': u'jrassi', u'name': u'Jason Rassi', u'email': u'rassi@10gen.com'}

Message: SERVER-13383 validateKeyPattern allow only numeric/string key types

(cherry picked from commit be9cd7b940531fe8a46e669155c81ca14e5189b0)
Branch: v2.6
https://github.com/mongodb/mongo/commit/b48e15efdd02c3217356484ad462dcde9d57920d

Generated at Thu Feb 08 03:31:33 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.