tags:

views:

20

answers:

1

In MongoDB you can convert a collection into a capped collection with the command convertToCapped, but is there a way to revert this change so a capped collection goes back to normal?

A: 

Hi! It's seems there is only one way to convert from capped collection to normal - just simple copy objects to normal collection and remove original capped collection.


db.createCollection("norm_coll");
var cur = db.cap_col.find()
while (cur.hasNext()) {obj = cur.next(); db.norm_coll.insert(obj);}

walla
I haven't found any command to just revert the conversion, so it must be true that the only option is to sump all elements into a new collection, which is a shame. I hope they work that out.
Abel Tamayo