-
Type: New Feature
-
Resolution: Unresolved
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Index Maintenance
-
None
-
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.
- is duplicated by
-
SERVER-50514 Custom default indexes per DB
- Closed