mongodb TTL not removing documents

后端 未结 2 1336
没有蜡笔的小新
没有蜡笔的小新 2020-12-10 18:15

I have a simple schema like:

{
    _id: String,      // auto generated
    key: String,      // there is a unique index on this field
    timestamp: Date() /         


        
2条回答
  •  佛祖请我去吃肉
    2020-12-10 19:01

    1. Can you show us what the inserted records actually look like?

    2. How long is "never"? Because there's a big warning:

      Warning: The TTL index does not guarantee that expired data will be deleted immediately. There may be a delay between the time a document expires and the time that MongoDB removes the document from the database.

    3. Does the timestamp field have an index already?

提交回复
热议问题