我无法创建仅包含字符串对象的列表
这就是我的模型的样子
class ProductSummary extends Realm.Object {}
ProductSummary.schema = {
name: 'ProductSummary',
properties: {
productId:'string',
name:'string',
description:'string',
rating:'int',
comments:'int',
categories:{type:'list',objectType:'string'},
images:{type:'list',objectType:'string'},
price:{type:'Price'}
}
};
这就是我从 api 得到的响应
"productSummary": { "links": [], "productId": "PRD_1ola611nd0t", "name": "Sample", "description": "<p>Sample<br></p>", "categories": [ "CAT_1rua60fnd0u" ], "rating": 0, "comments": 0, "tags": [], "image": "http://test.testsite.com/testProject/app-images/189_66164247/189_42527954.jpeg", "price": { "lowest": 100, "highest": 100 } }
我收到以下错误
Target Type 'string' doesn't Exists for property 'categories'
我是否以错误的方式创建类别字段。