-
Notifications
You must be signed in to change notification settings - Fork 585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Instance method toJSON() missing from TS definitions #2903
Comments
Apparently |
Eureka! This seems to work: (Realm.Object.prototype as any).toJSON.call(foo) So I guess the real issue is just the missing TS definition for |
While I'm at it, is |
@Dids It looks like an oversight from our side. No, |
@kneth Thanks! Luckily I managed to make my own safe recursive serializer with the help of Before I open a separate issue, are the changes made to the Realm JS change handler documented anywhere? Didn't see much in the release notes here and was wondering about several of the changes, including how the Realm objects referenced with each change event don't seem to have an |
@steffenagger Were |
@steffenagger The declarations are indeed there, but calling them throws an exception at runtime, unless called through the constructor, see this previous comment here: #2903 (comment) |
I see it at the top of the CHANGELOG, but with no version number. |
@Dids sorry for the late reply. Is Foo an interface (with separate schema) or a class model? Class models does not automatically get extended with We are focusing on getting v10 out of beta, so I'm fairly sure these changes will land in v10 beta first (#3044) @mattmogford No, the missing version number indicates it hasn't yet been release. The upcoming v6 release is still awaiting some changes. |
Goals
Realm JS v5.0.0 release notes mention the
.toJSON()
instance method that should be available on allRealm.Object
instances (as far as I can tell).Expected Results
I expect to be able to serialize Realm objects to a JSON string.
Actual Results
Realm.Object.toJSON()
does not exist, anywhere. Not in the API documentation, not in the sources.Steps to Reproduce
Query for Realm objects and attempt to serialize them.
Code Sample
Version of Realm and Tooling
The text was updated successfully, but these errors were encountered: