Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-1455

Add Section to Describe "dynamic" TTL collections

    XMLWordPrintableJSON

Details

    Description

      From the MongoDB Masters - it was noted that you can create "dynamic" TTL collections where the TTL can effectively be defined in the document. You can do this as follows:

      Set expireAfterSeconds to 0 and then set the date field (the one used to create the TTL index) to be X seconds (now() + X) in the future. X then effectively becomes the TTL for that document.

      Attachments

        Activity

          People

            zack.brown@10gen.com Zack Brown
            adamc Adam Comerford
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              10 years, 26 weeks, 2 days ago