How to convert a MongoDb's capped collection to non-capped collection? -
due specific business requirement storing data mongodb's capped collection complete requirement changed , want ot preserve records in collection.
i able find "converttocapped" command didn't find command perform vise versa operation.
how can convert non-capped collection?
you can copy it:
use admin db.runcommand( { renamecollection: "yourdb.yourcollection", to: "yourdb.oldcapped" } ) use yourdb db.oldcapped.copyto("yourcollection") then ensure required indexes , create users in uncapped yourcollection. run tests, , if happy results, drop oldcapped.
needless should done within maintenance window.
Comments
Post a Comment