Collection Defination
Contents = Backbone.Collection.extend({
model : Content,
initialize: function(models, args) {
console.log('in contents'+this.length);
},
content: function(objectid) {
return this.filter(function(content){ return content.get('objectid')==objectid; });
}
});
To change the model data
var model=Contents.content(data.objectid)[0]; model.set(data);
Ref :