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

the optional namespace field for createIndexes command

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • ALL

      if the createIndexes has the following syntax:

      db.runCommand(
          { createIndexes: <collection name>,
            indexes: 
               [
                  {
                      key: <key spec>,
                      name: <idx name> ,
                      ns: <namespace>
                  }
               ]
          }
      )
      

      such that you always specify the single collection and the db would be the database you run the command on, why have the optional ns field? since if it doesn't match the database and the collection name, it gives you

      "errmsg" : "namespace mismatch"
      

      Wouldn't the user always just omit it?

            Assignee:
            Unassigned Unassigned
            Reporter:
            kay.kim@mongodb.com Kay Kim (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: