Back

Handle long list of not equal

  • 0
  • Databases
  • Cloud
Said H.
14 Jan, 2025, 00:16

I understand that doing notEqual like: Query.notEqual('attr', [1, 2, 3])

Will become: attr != 1 OR attr != 2 OR attr != 3

Therefore, we need to set up the condition line by line to turn it into AND condition. Is there a limit to how many lines we can query in one go? I anticipate I will have a notEqual on 1000s records which makes it a very long line. Is there an efficient way to query long list of not Equal?

TL;DR
To efficiently query a long list of notEqual conditions, you can break it down into multiple smaller notEqual queries and combine them with "AND" conditions. There is no limit to the number of lines you can query in one go, but breaking them into smaller batches can improve performance.
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