Have an array of id’s
['tom','tim','joe','matt','scott']
Each model has an attribute that has an id.
How can I grab all 5 of the models and put in a new collection?
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.
How about using the underscore filter method on the corresponding collection?
If you need to
fetchthe models from your persistence layer, you might consider generating a collection of models with theidattribute set and providing an appropriate endpoint to populate the other attributes:Whatever endpoint you provide (
/bynamein the example above) should be prepared to generate a collection containing each model whose id was specified in themodelsparameter.