I am busy considering using a TTL index on a collection in MongoDB and wondering what the effect would be in the event of a restore.
For example, if I set the TTL on a collection to 2 days:
db.logEvents.ensureIndex({"datestamp":1},{expireAfterSeconds:172800})
If I were to back up the daily using mongodump restore a week later, would the logEvents collection be empty? For mongodump / mongorestore, I was considering modifying / removing the index manually in logEvents.metadata.json
before restoring - would this work?
What about if restoring from raw data files - how can I start up the mongod service with restored raw files in the datadir without immediately expiring data?