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

Improve collMod API for time-series expireAfterSeconds

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.0.0-rc0, 5.1.0-rc0
    • Component/s: None
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Backport Requested:
      v5.0
    • Sprint:
      Execution Team 2021-05-31

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: