Closed harshals closed 10 years ago
What's the reason behind using idAttribute rather than id?
helps when your models are using idAttribute other than id. eg. "_id" . http://backbonejs.org/#Model-idAttribute . I am trying to synchronise between an offline indexed-db and online MongoDB data. hence the "_id".
@harshals Sorry for the delay. This seems quite a specific problem. It would help if other people reported that need?
Please, help me understand why this behavior applies to more than just your mongo use case? It seems that it affects everyone just for your single use case? I'm more than happy to reopen if needed.
I have not tried the changes submitted here, but there should be a check for idAttribute. Backbone supports it for a reason: http://backbonejs.org/#Model-idAttribute I am currently syncing from a server that uses "schemaId" instead of "id". But every time i pull from the server, the adapter creates a new model instead of updating the previous one.
modified the library a bit to use idAttribute instead of json.id .