[SERVER-56934] Improve collMod API for time-series expireAfterSeconds Created: 13/May/21  Updated: 13/Nov/23  Resolved: 24/May/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.0.0-rc0, 5.1.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Louis Williams Assignee: Gregory Noma
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
is depended on by SERVER-55203 Change the stable release tag to r5.0... Closed
Documented
is documented by DOCS-14492 Investigate changes in SERVER-56934: ... Closed
Related
Backwards Compatibility: Fully Compatible
Backport Requested:
v5.0
Sprint: Execution Team 2021-05-31
Participants:

 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.



 Comments   
Comment by Vivian Ge (Inactive) [ 06/Oct/21 ]

Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you!

Comment by Githook User [ 24/May/21 ]

Author:

{'name': 'Gregory Noma', 'email': 'gregory.noma@gmail.com', 'username': 'gregorynoma'}

Message: SERVER-56934 Make expireAfterSeconds a top-level collection option

(cherry picked from commit b173494aa6b84b5d44c5f958fd78dd469596a314)
Branch: v5.0
https://github.com/mongodb/mongo/commit/e465a2c8dcc8d8f0676eaf266e809a71d946c07c

Comment by Githook User [ 24/May/21 ]

Author:

{'name': 'Gregory Noma', 'email': 'gregory.noma@gmail.com', 'username': 'gregorynoma'}

Message: SERVER-56934 Make expireAfterSeconds a top-level collection option
Branch: master
https://github.com/mongodb/mongo/commit/b173494aa6b84b5d44c5f958fd78dd469596a314

Comment by Louis Williams [ 17/May/21 ]

I discussed with geert.bosch (CC michael.gargiulo) and we agreed on the following:

  • Promote "expireAfterSeconds" to a top-level field of the collection options, not as a specific property of the "timeseries" options.
  • The "clusteredIndex" option becomes an optional boolean flag and continues to have all of the same limitations (i.e. may only be passed when creating a buckets collection). 
  • collMod should accept the "expireAfterSeconds" option as a top-level field of the command.
Generated at Thu Feb 08 05:40:34 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.