Can you remove a model by id? The documentation says you need to pass in the model itself to remove it.
So I need to fetch the model first and then remove it? I can’t just remove it by id?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Do you mean remove the model from a collection? Looking at the docs, it does seem like you need to pass in a real model, but the source code suggests that you can just pass in either the model
idor the modelcidas well, and all of the above should work (as well as arrays of all of the above).So all of the following should be equivalent:
I haven’t tested this, however.