Drop the collection:
model.collection.drop();
e.g:
var mongoose = require('mongoose')
, Schema = mongoose.Schema
, Collection = mongoose.Collection;
mongoose.connect('mongodb://localhost/test');
var TestSchema = new Schema({
user_id : {type : Number, index : true}
,username : {type : String}
});
var model_name = coll_name = 'taobao';
mongoose.model(model_name, TestSchema, coll_name);
var TAOBAO = mongoose.model(model_name, coll_name);
var taobao = new TAOBAO();
taobao.collection.drop();
Hope this will help you.