
I have a collection that has attribute named ids of type arrays , in ids some id will be store that will belong to it , i want to query this collection such that only that documents fetch in which any specific id containes in ids attribute , i will paas this id in input , how will i do that in react.

You can achieve that by creating another field named search
and add fullText
index to it

Then add all the ID's to that field seperate by space.

If I understood well you need to create a key index and use Query.equal('ids' ['id1', 'id2', '...'])

@Binyamin Why you prefer fullText? 🤔

Because I though he also liked to perform a search to find only one ID

If the match looking is for all the IDs together then your solution is the right one.

Yes, the description is not very clear, lets wait until he clarify what he is looking for

"title": String ,
"ids": Array[String],
amount: Int
)```

so when i pass any id in function , all document that contains this id in ids array should get

const queries = [Query.equal('ids', [...])]
const response = await databases.listDocuments('DATABASE_ID', 'COLLECTION_ID', queries);
This is what you should do with the JS SDK

its not working

try {
const queries = [Query.equal('ids', [id])]
return database.listDocuments(databaseID,
collectionId,
queries
);
} catch (e) {
console.error(e.message);
}
};```

Do you get any error, or you just get an empty array?

Does your collection or document have the correct permission?

i got empty array

My collection has proper permission , and indexing also

Please check this, issue: https://github.com/appwrite/appwrite/issues/2838

it seems like is not officially supported however the last comment says you can use Query.search
Recommended threads
- Subdomain failed verification
So I wanted to do a custom subdomain, because local storage doesn't work for me, but I've tried it a long time ago, it didn't work for me, and now I'm trying ag...
- [Node.js SDK] Bypass 2GB file limit?
Hello. Using either InputFile.fromPath or InputFile.fromBuffer throws this error: File size (2295467305) is greater than 2 GiB Bucket limit etc. is setup corre...
- Relationship null, even when relationshi...
Hi Everyone, im experiencing issues with set relation data. When im setting the document id from the related database most of them seem fine, except one table. ...
