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

    • Query Optimization

      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.

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            fields Adam Fields
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: