Uploaded image for project: 'Realm JavaScript SDK'
  1. Realm JavaScript SDK
  2. RJS-793

Realm casts array of string to an object

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: None

      <!---

      Bugs: To help you as fast as possible with an issue please describe your issue
      and the steps you have taken to reproduce it in as much detail as possible.

      -->

      Goals

      I have a schema

      export const User = {
          name: 'Profile',
          primaryKey: 'id',
          properties: {
              id: 'string',
              citizen: 'string?',
              imageUrl: 'string?',
              position: 'string?',
              firstName: 'Localized?',
              middleNames: 'Localized?',
              lastName: 'Localized?',
              emails: 'string[]',
              phones: 'string[]',
              location: 'Location?',
              dob: 'Dob?',
              address: 'Address?',
              identityNumber: 'IdentityNumber?'
          }
      };
      
      

      where emails and phones are arrays of strings;

      When getting data from realm emails and phones are casted to an object

      Expected Results

      "emails": ["adam.smith@example.com"]

      Actual Results

      "emails":

      {"0": "adam.smith@example.com"}

      Steps to Reproduce

      Just copy my collection and add an array of strings

      Version of Realm and Tooling

      • Realm JS SDK Version: 6.0.2
      • Node or React Native: v14 / 0.62.2
      • Client OS & Version: iOS 14

            Assignee:
            Unassigned Unassigned
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: