[SERVER-12478] There seems to be no way to check if collection has TTL index Created: 25/Jan/14 Updated: 10/Dec/14 Resolved: 27/Jan/14 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Shell |
| Affects Version/s: | 2.4.9 |
| Fix Version/s: | None |
| Type: | Question | Priority: | Major - P3 |
| Reporter: | Teemu Ikonen | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: |
| Description |
|
Is there any way to check collection index is set with TTL like expireAfterSeconds? The db.mycoll.stats() does not seem to tell that. > db.alliancej.ensureIndex( {created: 1}, {expireAfterSeconds: 300}) , |
| Comments |
| Comment by Teemu Ikonen [ 26/Jan/14 ] | |
|
Thanks, this is what I needed. | |
| Comment by J Rassi [ 25/Jan/14 ] | |
|
You can use db.alliancej.getIndexes() to look at the index list for a collection, or check if the following evaluates to a positive value:
|