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

Improve collMod API for time-series expireAfterSeconds

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.0.0-rc0, 5.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • v5.0
    • Execution Team 2021-05-31

      The API for specifying TTL on a time-series collection looks like this:

      db.createCollection('ts', {timeseries: {timeField: 't', expireAfterSeconds: 3600}}); 

      However, to change the "expireAfterSeconds" value, users have to specify a completely different "clusteredIndex" option:

      db.runCommand({collMod: 'ts', clusteredIndex: {expireAfterSeconds: 10}}) 

      This is confusing and we should make the API consistent between operations.

            Assignee:
            gregory.noma@mongodb.com Gregory Noma
            Reporter:
            louis.williams@mongodb.com Louis Williams
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: