-
Type: Task
-
Resolution: Unresolved
-
Priority: Unknown
-
None
-
Affects Version/s: None
-
Component/s: None
Goals
When I forget that a data field is required and try to write null to it, I want the error message to mention the 'data' type.
Expected Results
Expecting an error with the following message:
> RequiredTypes.dataRequired must be of type 'data', got 'null' (null)
Actual Results
I'm getting an error with the following message:
> RequiredTypes.dataRequired must be of type 'binary', got 'null' (null)
Or actually - I would love if "data" was called "binary" as it's so hard to tell apart from "dat*e*".
Steps to Reproduce
- Create a realm with a schema that has a required "data" property.
- Try to write a null to an object in that field.
Code Sample
const Realm = require('realm'); const realm = new Realm({ schema: [ { name: 'TestClass', properties: { requiredData: 'data' } } ], path: 'required-data.realm', }); realm.write(() => { realm.create('TestClass', { requiredData: null }); });
Version of Realm and Tooling
- Realm JS SDK Version: 2.0.4
- Node or React Native: Node
- Client OS & Version: Mac
- Which debugger for React Native: None