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

ObjectSchemaProperty's name property documented

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

      Goals

      I would like the documentation to match what I'm experiencing from the app.

      Expected Results

      I would expect that the documentation of and TypeScript type of{{ObjectSchemaProperty}} has a (perhaps optional) "name" field.
      At runtime the ObjectSchemaProperty objects read from an ObjectSchema of a Realm opened without specifying the schema has a name property.

      Actual Results

      The TypeScript types and documentation (https://realm.io/docs/javascript/latest/api/Realm.html#~ObjectSchemaProperty) doesn't mention the name property.

      Steps to Reproduce & Code Sample

      const Realm = require('realm');
      const realm = new Realm({ path: './some.realm' });
      const firstObjectSchema = realm.schema[0];
      const propertyNames = Object.keys(firstObjectSchema);
      const firstProperty = firstObjectSchema.properties[propertyNames[0]];
      // Outputs the name of the first property twice
      console.log(propertyNames[0], firstProperty.name);
      

      Version of Realm and Tooling

      • Realm JS SDK Version: 2.0.11
      • Node or React Native: N/A
      • Client OS & Version: N/A
      • Which debugger for React Native: N/A

            Assignee:
            Unassigned Unassigned
            Reporter:
            kraen.hansen@mongodb.com Kræn Hansen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: