Convert TTL Collection to Capped Collection

38 views
Skip to first unread message

TwoStep

unread,
Apr 13, 2015, 11:51:39 AM4/13/15
to mongod...@googlegroups.com
Hello:

I was wondering if there would be any problems converting a collection that used TTL to expire data to a capped collection? What would happen to the TTL interval? Would it be deleted from the collection records? I don't want both TTL and capped collection, I am merely attempting to convert two big collections from one to the other.

Thanks so much in advance!
Jason

Dwight Merriman

unread,
Apr 13, 2015, 12:33:18 PM4/13/15
to mongod...@googlegroups.com
capped can't be TTL as deletes aren't permitted for capped collections.

if you can make the TTL collection back to a regular colleciton, you can then run they convertToCapped command to complete the process.

i think getting rid of TTL feature is as simple as removing that index?  someone correct me if i have that wrong?


p.s. backup first :-)
Reply all
Reply to author
Forward
0 new messages