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

the optional namespace field for createIndexes command

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None
    • ALL

    Description

      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?

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: