Using primary keys with Ember Data

后端 未结 5 1541
情歌与酒
情歌与酒 2020-12-14 04:10

I\'ve been struggling for the past few days with primary keys and the last version of Ember Data.

I first read how to do it on the

5条回答
  •  猫巷女王i
    2020-12-14 04:22

    Try to extend your adapter like this:

       App.RESTSerializer = DS.RESTSerializer.extend({
          init: function() {
            this._super();
    
            this.map('App.MyModel', {
              primaryKey: "_id"
            });
          }
        });
    

提交回复
热议问题