api
api copied to clipboard
Support expiry of documents
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