[SERVER-12941] Improve error message for createIndexes commands with blank namespaces Created: 27/Feb/14  Updated: 22/Feb/16  Resolved: 04/Feb/16

Status: Closed
Project: Core Server
Component/s: Index Maintenance
Affects Version/s: None
Fix Version/s: 3.3.2

Type: Improvement Priority: Trivial - P5
Reporter: Kamran K. Assignee: Max Hirschhorn
Resolution: Done Votes: 0
Labels: 26qa, neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Backwards Compatibility: Fully Compatible
Sprint: Query 10 (02/22/16)
Participants:

 Description   

If you run createIndexes with an index spec that includes a blank namespace, you get a 'namespace mismatch' error. The mismatch is technically true, but it'd be more user-friendly to detect blank namespaces and have a more specific error.

> var spec = {key: {'foo': 1}, name: 'blank', ns: ''};
> db.getSiblingDB('repro').foo.runCommand('createIndexes', {indexes: [spec]});
{
	"spec" : {
		"key" : {
			"foo" : 1
		},
		"name" : "blank",
		"ns" : ""
	},
	"ok" : 0,
	"errmsg" : "namespace mismatch"
}


Version: b605f98c68a03fd0e65be72f9a22af4f107dee6b



 Comments   
Comment by Githook User [ 04/Feb/16 ]

Author:

{u'username': u'visemet', u'name': u'Max Hirschhorn', u'email': u'max.hirschhorn@mongodb.com'}

Message: SERVER-12941 Improve error messages from "createIndexes" command.
Branch: master
https://github.com/mongodb/mongo/commit/e50ae3193457da843f9bca825eb695207070ae3a

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