Improve error message for createIndexes commands with blank namespaces

XMLWordPrintableJSON

    • Fully Compatible
    • Query 10 (02/22/16)
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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

            Assignee:
            Max Hirschhorn
            Reporter:
            Kamran K. (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: