I want the collection i am inserting into mongodb to expire after a certain amount of time.
var db = mongo.GetDatabase("weatherdb");
using (mongo.RequestStart(db))
{
var collection = db.GetCollection<BsonDocument>("weatherdatanew24")
.EnsureIndex("Date" -> 1, "expireAfterSeconds" -> 120);
}
but the ensureINdex part is not working i think. Help please.