A Backbone.Model object maintains a ‘collection’ attribute.
In the Backbone source code, we have :
var Model = Backbone.Model = function(attributes, options) {
...
if (options && options.collection) this.collection = options.collection;
...
}
The annotated source says nothing about that, and the documentation references only functions.
I guess it’s mainly used when deleting the model : the collection removes this model.
But what if the model belongs to many collections ? Is there a danger to use/override this collection attribute ?
It’s used in two places (look a bit further down in the annotated source).
urlfunction, if the collection exists with a URL scheme, it uses that to construct a URL for the model.