[SERVER-3573] I would like a way to specify automatic creation of indexes on new collections Created: 10/Aug/11  Updated: 06/Dec/22

Status: Open
Project: Core Server
Component/s: Index Maintenance
Affects Version/s: None
Fix Version/s: features we're not sure of

Type: New Feature Priority: Major - P3
Reporter: Adam Fields Assignee: Backlog - Query Optimization
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-50514 Custom default indexes per DB Closed
Assigned Teams:
Query Optimization
Participants:

 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.



 Comments   
Comment by Adam Fields [ 10/Aug/11 ]

Naturally, there would also need to be a way to list existing auto index specifications.

Generated at Thu Feb 08 03:03:26 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.