I saw several ways to do this, but I'm curious that the โmost correctโ approach uses the last line (master parity) of the data ember-data rev 12
Option number 1 (looks the most obvious)
App.Post = DS.Model.extend({ primaryKey: '_id', _id: DS.attr('string') });
Option number 2 (match it using the adapter by type)
App.Adapter.map('App.Post', { primaryKey: '_id' });
Option number 3 (hard code in the serializer - all models have the same user pk)
App.MySerializer = DS.RESTSerializer.extend({ primaryKey: function(type) { return '_id'; } });
source share