-
Type: Bug
-
Resolution: Gone away
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
Goals
A nice idiomatic interface to objects read from a Realm
Expected Results
I expect all properties defined in the schema to be returned from Object.getOwnPropertyDescriptors(objectFromRealm) to equal:
{ value: "The actual value ...", writable: true, enumerable: true, configurable: false }
Actual Results
The actual implementation returns
{ value: undefined, writable: false, enumerable: true, configurable: true }
Offending code is https://github.com/realm/realm-js/blob/napi/src/node/node_class.hpp#L848-L865.
Steps to Reproduce & Code Sample
const Realm = require("realm"); const realm = new Realm({ schema: [{ name: "Person", properties: { name: "string" } }], }); realm.write(() => { realm.create("Person", { name: "Joe" }); }); const persons = realm.objects("Person"); for (const person of persons) { console.log(Object.getOwnPropertyDescriptors(person)); }
Version of Realm and Tooling
- Realm JS SDK Version: 3.7.0-alpha.0
- Node or React Native: Node.js
- Client OS & Version: Mac
- Which debugger for React Native: None