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

OneOf query should work for DateTime variables in Dart #495

Open
raphire08 opened this issue Dec 16, 2022 · 1 comment
Open

OneOf query should work for DateTime variables in Dart #495

raphire08 opened this issue Dec 16, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@raphire08
Copy link

raphire08 commented Dec 16, 2022

I have array of date values. Need to check if any matching data exists in database for any one of the date values in array

A clear and concise description of what you want to happen.

We can query on dateTime data using lessThan or between

final qc = Data_.dateVariable.lessThan(date.millisecondsSinceEpoch);

Is it possible to support .oneOf query for dateTime data type ?

List<DateTime> dates;
List<int> datesEpoch = dates.map((e) => e.millisecondsSinceEpoch);
final qc =
        Data_.dateVariable.oneOf(datesEpoch);

Currently this is throwing error

Unsupported operation: Unsupported type for IN: 10

Describe alternatives you've considered

Alternative is to find the max and min of dates from array and use between query

@raphire08 raphire08 added the enhancement New feature or request label Dec 16, 2022
@greenrobot-team
Copy link
Member

Thanks for reporting! I can't find right now why it was chosen that this does not work, but we'll have a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants