Skip to content
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

Special property names #86

Closed
tmarzec opened this issue Sep 6, 2022 · 0 comments · Fixed by #123
Closed

Special property names #86

tmarzec opened this issue Sep 6, 2022 · 0 comments · Fixed by #123
Labels
bug Something isn't working O-Community

Comments

@tmarzec
Copy link
Contributor

tmarzec commented Sep 6, 2022

The problem

key and _objectKey are fields, which have a special meaning for this project.

key

It is a field, that has to be set to every row in antd table as its unique identifier. For that reason, having a schema with that property causes problems. Currently, that property is not presented in the table, and it is overwritten (although no changes are done to the database, only the visible data is changed).

_objectKey

This is a reserved property name for Realm-specific unique object identification. Currently, any property with that name would be overwritten.

Solution

It would be enough to wrap every object in another object in the following manner:

{
    realObject: {
        ...
    },
    _objectKey: ...,
}

This would fix the problem with overwriting the _objectKey property.
Further research should be done about what happens when a schema has this field - would it overwrite the object._objectKey() method? Would RealmJS allow that?

The problem with key property could potentially be solved be making it a special case when declaring column objects for and tables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working O-Community
Projects
None yet
1 participant