backbone.jsbackbone.js-collections

Will backbonejs model cid be unique across multiple collection?


I want to know that will backbone model cid will unique among multiple collection. Example: I have pageCollection and each pageCollection will contains another collection called controlCollection.

If I am creating control model, its cid will be unique among all controlCollection inside all pageCollection?

hierarchy:

pageCollection
  ->pageModel
    ->controlCollection
      ->controlModel

Solution

  • Considering same model can be present inside multiple collections by design in backbone, it'll be unique. No other model will have same cid.