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

I would like a way to specify automatic creation of indexes on new collections

    XMLWordPrintable

    Details

      Description

      New feature request: we often make collections dynamically based on some naming convention, and I'd like a way to specify that any new collections whose name matches a regexp condition should automatically get a particular set of indexes when created.

      I'd envision this as being specified by a hash where the key is the regexp and the value is an array of normal index hash specifications to add.

      Something like:

      db.autoIndexCollections( { "/page_logs_%d

      {6}

      /": [

      {"date":-1}

      ,

      {"source":1}

      ] } );

      would create two indexes on date descending and source ascending for a newly created page_logs_201108 collection.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              backlog-query-optimization Backlog - Query Optimization
              Reporter:
              fields Adam Fields
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated: