model.clear

clearmodel.clear([options]) Removes all attributes from the model, including the id attribute. Fires a "change" event unless silent is passed as an option.

model.clone

clonemodel.clone() Returns a new instance of the model with identical attributes.

model.attributes

attributesmodel.attributes The attributes property is the internal hash containing the model's state â usually (but not necessarily) a form of the JSON object representing the model data on the server. It's often a straightforward serialization of a row from the database, but it could also be client-side computed state. Please use set to update the attributes instead of modifying them directly. If you'd like to retrieve and munge a copy of the model's attributes, use _.clone(model.attrib

model.chain

chain

model.changed

changedmodel.changed The changed property is the internal hash containing all the attributes that have changed since its last set. Please do not update changed directly since its state is internally maintained by set. A copy of changed can be acquired from changedAttributes.

Model

constructor / initializenew Model([attributes], [options]) When creating an instance of a model, you can pass in the initial values of the attributes, which will be set on the model. If you define an initialize function, it will be invoked when the model is created. new Book({ title: "One Thousand and One Nights", author: "Scheherazade" }); In rare cases, if you're looking to get fancy, you may want to override constructor, which allows you to replace the actual constructor function f

invalid event

"invalid" (model, error, options) â when a model's validation fails on the client.

collection.without

without

error event

"error" (model_or_collection, response, options) â when a model's or collection's request to the server has failed.

collection.where

wherecollection.where(attributes) Return an array of all the models in a collection that match the passed attributes. Useful for simple cases of filter. var friends = new Backbone.Collection([ {name: "Athos", job: "Musketeer"}, {name: "Porthos", job: "Musketeer"}, {name: "Aramis", job: "Musketeer"}, {name: "d'Artagnan", job: "Guard"}, ]); var musketeers = friends.where({job: "Musketeer"}); alert(musketeers.length);