Realm-js: List of primitive type in schema

Created on 13 Feb 2017  路  4Comments  路  Source: realm/realm-js

Hi,

How can I declare a schema that have a field that is a list of doubles?
I tried the following schema, but it's not working.

const TestSchema = {
  name: 'Test',
  primaryKey: 'id',
  properties: {
    id: 'string',
    something: { type:'list', objectType:'double' },
  },
}

image

T-Feature

Most helpful comment

You are right, and work is being done on this now.

All 4 comments

Currently, lists of primitive types are not supported. You will have to declare a class that contains a double property and create the list out of that. Suboptimal yes, and we are working on improving this.

I apologize for bumping a closed issue, but should this not be kept open and labeled as something like a feature?

You are right, and work is being done on this now.

It has been merged into 2.0.x

Was this page helpful?
0 / 5 - 0 ratings