Back

Find value in List<String> attribute with listDocuments()

  • 2
  • Android
  • Databases
retr122
22 Jul, 2023, 15:35

Hello. I write my app in Java and need to delete specific value from documents. But I don't know how to list documents and find only documents with this value. In this collection, I have attribute List<String> with values. I need to find ONLY documents that List<String> contains my value. How to do that with Queries?

TL;DR
Currently, Appwrite does not support queries on array attributes. However, you can create a search index and use a search query as a workaround. There is an open issue related to this feature on GitHub if you want to stay updated. Simply use the search index to find documents that contain your specified value in the List<String> attribute.
Samuel Kings
22 Jul, 2023, 16:07

Aswerugad, I was just thinking about this same thing like 4 hours ago. Nothing of such in the Query docs.

Drake
22 Jul, 2023, 22:23

Appwrite doesn't support queries on array attributes at the moment. You might want to πŸ‘ this issue https://github.com/appwrite/appwrite/issues/2838.

A hack right now if you have an array of words is to make a search index and use the search query.

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