Backbone Collection Find I Want Only One Result
I'm working with find Backbone and I have 20-30 results, I need the first result and I don't have the id for filter for id. model = coleccion.find( function(e){ return
Solution 1:
You can use findWhere method:
collection.findWhere(attributes)
Solution 2:
You can use collection.at(0) if you want to get the first model. Or collection.shift() if you want to get the first model, then remove this model from the collection. Read more at Backbonejs Collection
Post a Comment for "Backbone Collection Find I Want Only One Result"