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

@count/@size not supported for mixed containing a collection #7280

Closed
nirinchev opened this issue Jan 23, 2024 · 1 comment
Closed

@count/@size not supported for mixed containing a collection #7280

nirinchev opened this issue Jan 23, 2024 · 1 comment
Assignees

Comments

@nirinchev
Copy link
Member

Looks like @count is not a supported operator when querying a mixed property, even if the value contains a collection. Am I misunderstanding how the query should be constructed or is this a scenario that will never work? Here's a simplified test in dart:

realm.write(() {
  realm.add(AnythingGoes(
    oneAny: RealmValue.from([
      1,
      'a',
      {'foo': 'bar'}
    ])));

});

final listLengthQuery = realm.query<AnythingGoes>('oneAny.@size > 2');

oneAny is a property of type Mixed; we're adding a list to it and then trying to find all objects where oneAny has size > 2. I would expect this to implicitly translate to something like oneAny.@type IN [List, Dictionary] && oneAny.asCollection().@size > 2.

@jedelbo
Copy link
Contributor

jedelbo commented Jan 26, 2024

Fixed by #7287

@jedelbo jedelbo closed this as completed Jan 26, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants