-1

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
No one
  • 1,130
  • 1
  • 11
  • 21

1 Answers1

1

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

T J
  • 42,762
  • 13
  • 83
  • 138
  • Thanks @T J.... I am somehow getting duplicate cid in above architecture with controlModel model.. I don't know how to find it out as it happening very rarely. – No one Jun 05 '19 at 15:08
  • Are you sure it's totally different model instances? what version of underscore/backbone are you using? Maybe an old version with some bug? – T J Jun 05 '19 at 15:16
  • hmm... Yes. I hope the same.. I am using Backbone.js 1.1.2 with Underscore.js 1.5.2. – No one Jun 05 '19 at 15:50