0

The problem represented in the following code: http://jsfiddle.net/W7Rq9/

I have a collection of models (Photos). Each model (Photo) has its own collection (Tags) and sometimes the data stored in tags is repeated. And when I fetch my collection of photos, the repeated tags is deleted.

I think it will be more clearer in the example http://jsfiddle.net/W7Rq9/

evfwcqcg
  • 15,755
  • 15
  • 55
  • 72

1 Answers1

2

Backbone will not allow two objects with the same id to be in the same collection.

You can give them all a unique id and/or change the attribute used as the object's id, but whatever attribute you set as the object id must be unique for all of the objects within a given collection.

Derick Bailey
  • 72,004
  • 22
  • 206
  • 219