Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-558

db.collection.ensureIndex options should include name option

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • Server_Docs_20231030
    • None
    • manual
    • None

    Description

      In here:
      http://docs.mongodb.org/manual/reference/method/db.collection.ensureIndex/

      E.g.

      db.test.ensureIndex({foo:1},{name:"myfooindex"})

      It should be written than you can specify the index name, instead of being automatically generated by concatenating the names of the indexed fields and their direction (i.e. 1 or -1 for ascending or descending).
      http://www.mongodb.org/display/DOCS/Indexes#Indexes-CreationOptions

      Attachments

        Activity

          People

            epc Ed Costello
            gianfranco Gianfranco Palumbo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              11 years, 20 weeks, 6 days ago