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 depended on by
-
DOCS-1044 Document process to update expireAfterSeconds (TTL collections)
-
- Closed
-
- is related to
-
SERVER-6701 TTL expiration using _id index
-
- Closed
-
- related to
-
SERVER-211 TTL collections
-
- Closed
-