[SERVER-6700] Allow updates to expireAfterSeconds field for TTL indexes Created: 03/Aug/12 Updated: 16/Nov/21 Resolved: 24/Dec/12 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Index Maintenance, Usability |
| Affects Version/s: | 2.1.2 |
| Fix Version/s: | 2.3.2 |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Kevin Matulef | Assignee: | Kevin Matulef |
| Resolution: | Done | Votes: | 4 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Description |
|
This can be accomplished using the collMod command. The syntax for changing the value of the expireAfterSeconds field is:
For instance:
|
| Comments |
| Comment by auto [ 08/Jan/13 ] | ||
|
Author: {u'date': u'2013-01-08T19:49:45Z', u'email': u'tad@10gen.com', u'name': u'Tad Marshall'}Message: Wait for replication before checking secondary in part 3. | ||
| Comment by auto [ 25/Dec/12 ] | ||
|
Author: {u'date': u'2012-12-25T01:11:05Z', u'email': u'eliot@10gen.com', u'name': u'Eliot Horowitz'}Message: | ||
| Comment by Kevin Matulef [ 24/Dec/12 ] | ||
|
This can now be accomplished using the collMod command. The syntax for changing the value of the expireAfterSeconds field is:
For instance:
| ||
| Comment by auto [ 24/Dec/12 ] | ||
|
Author: {u'date': u'2012-12-24T22:30:16Z', u'email': u'matulef@gmail.com', u'name': u'Kevin Matulef'}Message: | ||
| Comment by Kevin Matulef [ 24/Sep/12 ] | ||
|
This is a simple theoretical change, but a bit trickier to implement than it sounds. For the time being, a workaround is to declare a normal (non-TTL) index on the time-based field you want to use, then use the collMod command to change the memory allocation scheme for the collection:
and finally write your own external script that simulates the TTL monitor by deleting old docs every 60 seconds or so. It's not the most elegant solution, but it may be preferable if you frequently change your definition of "old." | ||
| Comment by David Snelling [ 24/Sep/12 ] | ||
|
This would be huge for us. We are just having to do this week against a very large dataset. TTL has been a critical and great feature for us in our analytics to handle sliding windows. | ||
| Comment by Eldar Insafutdinov [ 24/Sep/12 ] | ||
|
+1 | ||
| Comment by David Snelling [ 24/Sep/12 ] | ||
|
1++ | ||
| Comment by Vineeth Narayanan [ 05/Sep/12 ] | ||
|
+1 |