DS.JSONSerializer#primaryKey

primaryKey{String}

Defined in addon/serializers/json.js:87

The primaryKey is used when serializing and deserializing data. Ember Data always uses the id property to store the id of the record. The external source may not always follow this convention. In these cases it is useful to override the primaryKey property to match the primaryKey of your external store.

Example

app/serializers/application.js
import DS from 'ember-data';

export default DS.JSONSerializer.extend({
  primaryKey: '_id'
});

Default: 'id'

doc_EmberJs
2016-11-30 16:49:57
Comments
Leave a Comment

Please login to continue.