Ember.js ember解析适配器有许多错误

Ember.js ember解析适配器有许多错误,ember.js,parse-platform,ember-data,Ember.js,Parse Platform,Ember Data,在parse.com上的数据库中,我有一个带有以下字段的表Item: "objectId": "O0NkhZAcMd", "price": "100", "topping": [ { "__type": "Pointer", "className": "Topping", "objectId": "iKbMWHZrEB" }, { "__type": "Pointer", "className

在parse.com上的数据库中,我有一个带有以下字段的表
Item

"objectId": "O0NkhZAcMd",
"price": "100",
"topping": [
    {
        "__type": "Pointer",
        "className": "Topping",
        "objectId": "iKbMWHZrEB"
    },
    {
        "__type": "Pointer",
        "className": "Topping",
        "objectId": "yIIkePYKSS"
    },
    {
        "__type": "Pointer",
        "className": "Topping",
        "objectId": "lZJ4Kpqodf"
    },
...
]
Topping有一个字段
title
price

对于该数据库,我有以下模型:

app/models/item.js:

import DS from 'ember-data';

export default DS.Model.extend({
  objectId: DS.attr(),
  price: DS.attr(),
  topping: DS.hasMany('topping', {async: true}),
}); 
import DS from 'ember-data';

export default DS.Model.extend({
  objectId: DS.attr(),
  price: DS.attr(),
  title: DS.attr(),
});
app/models/topping.js:

import DS from 'ember-data';

export default DS.Model.extend({
  objectId: DS.attr(),
  price: DS.attr(),
  topping: DS.hasMany('topping', {async: true}),
}); 
import DS from 'ember-data';

export default DS.Model.extend({
  objectId: DS.attr(),
  price: DS.attr(),
  title: DS.attr(),
});
app/models/item.js
中添加
topping:DS.hasMany('topping',{async:true})
时,我开始出现以下错误:

Error while processing route: menu Assertion Failed: Ember Data expected a number or string to represent the record(s) in the `topping` relationship instead it found an object. If this is a polymorphic relationship please specify a `type` key. If this is an embedded relationship please include the `DS.EmbeddedRecordsMixin` and specify the `topping` property in your serializer's attrs object.
我不知道需要指定哪种类型以及在哪里执行。
有人能帮我吗

我使用:

  • 余烬1.13.7
  • 余烬数据1.13.8
  • ember解析适配器0.5.3

尝试将
所属关系添加到您的
顶级
模型中

import DS from 'ember-data';

export default DS.Model.extend({
  objectId: DS.attr(),
  price:    DS.attr(),
  title:    DS.attr(),
  item:     DS.belongsTo('item', { async: true }) 
});

尝试将
归属\u to
关系添加到您的
topping
模型中

import DS from 'ember-data';

export default DS.Model.extend({
  objectId: DS.attr(),
  price:    DS.attr(),
  title:    DS.attr(),
  item:     DS.belongsTo('item', { async: true }) 
});