api icon indicating copy to clipboard operation
api copied to clipboard

Support expiry of documents

Open danwdart opened this issue 6 years ago • 0 comments

Expected behavior

I'd like to be able to expire a document after a number of seconds. This could be an internal thing for DB-agnostic setups.

Actual behavior

Specifying {"expireAfterSeconds":30} in the options forwarded to Mongo doesn't help, as we use integer date formats instead of Mongo's expected Date()

Steps to reproduce the problem

I tried

{
        "keys": {
          "_createdAt": 1
        },
        "options": {
          "expireAfterSeconds": 30
        }
      }

but Mongo didn't like it, because _createdAt is an integer.

Package details

Package version, operating system, etc API 3

danwdart avatar May 25 '18 14:05 danwdart