This is not a query object returned by Mongoose, the only valid method is .remove() :
MyModel.remove(function(err,removed) {
This is the same as:
MyModel.remove({}, function(err,removed) { });
Also, how do you determine which documents are not deleted? Perhaps he is looking for the wrong collection. Mongoose pluralizes the default collection name unless you explicitly specify the collection name as in:
mongoose.Model( "MyModel", myModelSchema, "mymodel" )
Without this third argument or other indication in the schema, the collection name is implied as "mymodels". Therefore, make sure that you have the correct collection, as well as the correct connection to the database, where you expect documents to be deleted.
Neil lunn
source share