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

TTL index should be able to include _id field, why not ?

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Indexing
    • Labels:
      None

      Description

      I would like to suggest an improvement to MongoDB.

      As we all know the _id field contains a timestamp of when the document was created.  Currently very often we have developers creating an explicit ts field say "createdOn", just because they wanted to use the TTL index to expire documents based on creation ts.

      Wouldn't it be wonderful if TTL index can be specified for _id field, since all the information required for expiring documents are already there ?

      Please let me know if you have any questions.  I also spoke to Kirby (Mongo U) and Muthu Chinnasamy about this at the MongoDB World 2018.

       

      Thank you

       

      Alex Leong

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              backlog-server-execution Backlog - Execution Team
              Reporter:
              aleong@indeed.com Alex Leong
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: