Back

[CLOSED] How can we do OR queries?

  • 0
  • Self Hosted
  • Databases
  • Web
skavank
31 Jul, 2023, 12:12

Hey!

Since we don't have any way to do conditional document access, we have to lock down all permissions and roll our own APIs. Now I'm having another problem, since we cannot do OR queries, we might not be able to achieve optimal document fetching even server-side.

Take this basic example: We want to get all documents from a collection, that is either non-private or owned by the user.

Pseudo SQL:

TypeScript
SELECT * FROM Posts 
  WHERE status !== 'private' 
  OR $user.id == owner

Is there a way to achieve this?

TL;DR
Currently, there is no support for OR queries in the Appwrite platform. This limitation prevents optimal document fetching even server-side. One possible solution is to lock down all permissions and create custom APIs to handle conditional document access. However, this workaround may not be ideal. For more information and updates on this issue, you can check the following link: https://github.com/appwrite/appwrite/issues/2740.
skavank
31 Jul, 2023, 12:22

How can we do OR queries?

Guille
31 Jul, 2023, 13:18

Currently, there is no support for OR queries, check this issue: https://github.com/appwrite/appwrite/issues/2740

skavank
31 Jul, 2023, 14:56

Thanks!

Guille
31 Jul, 2023, 15:06

[CLOSED] How can we do OR queries?

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