Realm JS Create objects with primitive data type list
Now we can create a list of only string object or any primitive value type.
e.g.
class VarietyModel {}
VarietyModel.schema = {
name: 'Variety',
primaryKey: 'varietyId',
properties: {
varietyId: 'int',
varietyName: 'string',
products: { type: 'string?[]', default: [] }, // products will array of strings ['product1','product2'..]
},
};
export default VarietyModel;
Reff:
Realm Types
Realm List Properties