Back

Query null OR greaterThanEqual than

  • 0
  • Databases
  • Functions
whataboutno13
25 Aug, 2023, 10:22

I am trying to query a datetime attribute that can be null. For my search I want the query to return all projects after a given date (greaterThanEqual) or isNull. So far I cannot see how I can build a query like this, since the Queries are connected via AND and only in a Query itself things can be logically connected via OR.

TL;DR
The user is having an issue with implementing a query in their Dart app using the appwrite package version 7.1.0. They want to query a datetime attribute that can be null and return all projects after a given date or isNull. However, they are unable to find a way to build this query since the queries are connected using AND and not OR. A solution suggested by another user is to use two separate queries for now. There is also a related issue linked for reference.
joeyouss
25 Aug, 2023, 13:57

You can use two separate queries for now. Also, linking a related issue: https://github.com/appwrite/appwrite/issues/2740

whataboutno13
4 Sep, 2023, 13:38

Alright thanks

whataboutno13
4 Sep, 2023, 14:00

I want to implement it in a function but it seems like there is no Query.isNull there... At least the compiler does not know it πŸ˜…

whataboutno13
4 Sep, 2023, 14:02

Can isNull only be used by the client?

whataboutno13
4 Sep, 2023, 14:04

I am using dart_appwrite: ^7.1.0

whataboutno13
4 Sep, 2023, 14:07

Yes thats the problem. I updated to 8.0.0 and it compiled correctly πŸ‘

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more