Is there any one command in Mongoid to delete an object using id?
Something like,
ClassName.delete(:id)
Currently i dont see anything like that and im using,
obj = ClassName.find(:id)
obj.delete
Can it be any better?
Another Way
ClassName.any_in(:_id => ["id1", "id2"]).destroy_all
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With