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

Cannot include null in the .query() method second argument List<Object> #871

Closed
mongodben opened this issue Aug 24, 2022 · 0 comments · Fixed by #872
Closed

Cannot include null in the .query() method second argument List<Object> #871

mongodben opened this issue Aug 24, 2022 · 0 comments · Fixed by #872
Assignees

Comments

@mongodben
Copy link
Contributor

mongodben commented Aug 24, 2022

Currently, when creating a query using Realm Query Language, you cannot include null as one of the arguments in the .query() method's second argument, as it's a list of objects, but doesn't allow for nullability.

Instead you'd have to use the native RQL nil type, which isn't particularly intuitive (and also isn't well documented..but i suppose i could help with that aspect ).

Example

for example, this query won't work:

realm.query<SomeRealmObject>("foo == $0", [null]);

but you could get the same effect using RQL nil:

realm.query<SomeRealmObject>("foo == nil");
@mongodben mongodben changed the title Cannot include null in the .query() method second argument List<Object> Cannot include null in the .query() method second argument List<Object> Aug 24, 2022
@nielsenko nielsenko linked a pull request Aug 25, 2022 that will close this issue
@sync-by-unito sync-by-unito bot closed this as completed Aug 26, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants