You can do something like the following:
ClassName.delete_all(conditions: { _id: BSON::ObjectId("whatevertheidis")})
You need to underline the symbol _id
or it won't work.
Also, it may not matter, but destroy_all
will trigger the callback methods of the model and delete_all
not.
source
to share