bobthecow / genghis

The single-file MongoDB admin app
http://genghisapp.com
MIT License
1.45k stars 166 forks source link

Allow emptying a collection #107

Closed internalfx closed 11 years ago

internalfx commented 11 years ago

It would be nice if you could empty a collection without removing it, to keep the indexes and such.

bobthecow commented 11 years ago

:+1:

bobthecow commented 11 years ago

I haven't yet implemented this, because it's not very performant on large collections. I'm thinking I'll fake it by dropping the collection then re-creating all the indexes on a new collection. Sound reasonable?

bobthecow commented 11 years ago

I've implemented API support for truncating by dropping a collection then recreating its indices. It seems to work well. I'll work it into the UI and get it in the next point release.

bobthecow commented 11 years ago

This has been implemented and will appear in the next point release (v2.6.0)

bobthecow commented 11 years ago

(Just kidding, v2.4.0)