Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-6700

Allow updates to expireAfterSeconds field for TTL indexes

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.3.2
    • Affects Version/s: 2.1.2
    • Labels:
      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 } } )

            Assignee:
            matulef Kevin Matulef
            Reporter:
            matulef Kevin Matulef
            Votes:
            4 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: