How do I remove all but the first n objects from a collection in MongoDB? For example, I only want to keep the first 2000 objects in my collection, but at the moment, there are 15000 objects.
EDIT: My question is more generalized than this related question. Not a duplicate.