Support for primitive lists
See original GitHub issue@alazier I am unable to create a list of only string objects
This is how my model looks like
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'}
}};
This is how the response looks like
"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 } }
In realm for android there is a way to wrap these types of primitive lists how could I do this using realm js
Error Message
`Target Type 'string' doesn't Exists for property 'categories'`
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:8 (2 by maintainers)
Top GitHub Comments
I think this feature is a must! It’s not practical to that trick and transform all the
string
list to{value: 'string}
listThis is definitely something we hope to add. For now you have to create an object to wrap your primitive type:
Its a bit annoying as when creating/accessing string objects you need to access/set the value property which might require some data transformation when importing or exporting data.