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

Improve error message for createIndexes commands with blank namespaces

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

      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@mongodb.com Max Hirschhorn
            Reporter:
            kamran.khan Kamran K.
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: