[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: |
|
||||||||
| 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. |