根据http://emberjs.com/api/data/classes/DS.EmbeddedRecordsMixin.html
没有id属性的记录不被视为嵌入记录,模型实例必须具有要与Ember数据一起使用的id属性。
如果那样,我将如何使用如下模型:
{
"_id": "545b54f20dbd7015f015359a",
"comments": [
{
"msg": "what is this jelly",
"time": "1415271666",
"user": {
"id": "53fefc9ee4b07d3fe92fc077",
"username": "kfir124"
}
}
],
"files": [
{
"key": "1415271653.39af9c9fb8cc8b49dcaac5eec72614ce85.jpg",
"order": 0
}
],
"time": "1415271666",
"uploader": {
"id": "53fefc9ee4b07d3fe92fc077",
"username": "kfir124"
}
}
因此上传器可能是嵌入式记录,但文件和评论呢?它们都是在主模型命名空间之外不存在的对象数组,因此它们没有ID