-
Type: Improvement
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: 2.1.2
-
Component/s: Index Maintenance, Usability
-
None
This can be accomplished using the collMod command. The syntax for changing the value of the expireAfterSeconds field is:
db.runCommand( {"collMod" : [collection] , "index" : { "keyPattern" : [indexPattern] , "expireAfterSeconds" : [newVal] } } )
For instance:
db.runCommand( {"collMod" : "foo" , "index" : { "keyPattern" : {a : 1} , "expireAfterSeconds" : 3600 } } )
- is related to
-
SERVER-6701 TTL expiration using _id index
- Closed
- related to
-
SERVER-211 TTL collections
- Closed