1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Mongodb TTL Index not expiring documents from collection

Discussion in 'Programming/Internet' started by Ramraj Patel, Sep 16, 2020.

  1. Ramraj Patel

    Ramraj Patel Guest

    I have TTL index in collection fct_in_ussd as following

    db.fct_in_ussd.createIndex(
    {"xdr_date":1},
    { "background": true, "expireAfterSeconds": 259200}
    )


    {
    "v" : 2,
    "key" : {
    "xdr_date" : 1
    },
    "name" : "xdr_date_1",
    "ns" : "appdb.fct_in_ussd",
    "background" : true,
    "expireAfterSeconds" : 259200
    }


    with expiry of 3 days. Sample document in collection is as following

    {
    "_id" : ObjectId("5f4808c9b32ewa2f8escb16b"),
    "edr_seq_num" : "2043019_10405",
    "served_imsi" : "",
    "ussd_action_code" : "1",
    "event_start_time" : ISODate("2020-08-27T19:06:51Z"),
    "event_start_time_slot_key" : ISODate("2020-08-27T18:30:00Z"),
    "basic_service_key" : "TopSim",
    "rate_event_type" : "",
    "event_type_key" : "22",
    "event_dir_key" : "-99",
    "srv_type_key" : "2",
    "population_time" : ISODate("2020-08-27T19:26:00Z"),
    "xdr_date" : ISODate("2020-08-27T19:06:51Z"),
    "event_date" : "20200827"
    }


    Problem Statement :- Documents are not getting removed from collection. Collection still contains 15 days old documents.

    MongoDB server version: 4.2.3

    Block compression strategy is zstd

    storage.wiredTiger.collectionConfig.blockCompressor: zstd

    Column xdr_date is also part of another compound index.

    Login To add answer/comment
     

Share This Page