TTL with 0 seconds doesn't create the script correctly.

Lucas Soares shared this problem 6 years ago
Solved

I'm trying to create a TTL index with 0 on expireAfterSeconds to use the TTL index like this:

https://docs.mongodb.com/manual/tutorial/expire-data/#expire-documents-at-a-specific-clock-time


The NoSqlBooster is creating this following script:

db.getCollection("spring_cache").createIndex({ "expire_at": 1 }, { "name": "expire_at" })


Instead of:

db.getCollection("spring_cache").createIndex({ "expire_at": 1 }, { "name": "expire_at", "expireAfterSeconds": 0 })


Using the index build tool like this:

/9a87e13cc79407960eff48e08b8169a5

Replies (2)

photo
1

Thank you for your bug report. We will fix this issue in the next update.

photo
1

Resolved in the version 4.7.0

Leave a Comment
 
Attach a file