Mongoose: How to drop collection

Created on 12 Sep 2016  路  1Comment  路  Source: Automattic/mongoose

For testing purposes I would like to empty a capped collection. It's not possible to do so using remove().

I was trying to issue this using MyModel.collection.<methods-from-mongodb> or mongoose.connection.<again-some-variations>.

What is the correct way and is it possible in the currecnt version 4.4.20?

help

Most helpful comment

MyModel.collection.drop()

>All comments

MyModel.collection.drop()

Was this page helpful?
0 / 5 - 0 ratings