PyMongo: method to run command for collMod TTL index update

Hi fellow developers,

I’m using mongodb with python using pymongo library. My usecase takes advantage of TTL indexes provided by mongo. But, I’ve a scenario where I want to update the ‘expireAfterSeconds’ time using collMod using Pymongo for which I cannot find anything on pymongo docs. If anyone could point in the right direction that would be really useful. Here’s the mongo db docs, and javascript implementation for the same.

Also, if anyone has ever used this feature of updating index using ‘collMod’ how bad is the performance hit for like 100,000 documents.

If anyone came across same issue, check out this post by @Shane

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.