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 (
e.get('car').category === data_category &&
e.get('full_empty') === 0 &&
e.get('idprovider') === data_provider
);
}
);
You can use findWhere method:
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