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.
Summary
User is seeking help with integrating a query in their code. They shared a GitHub issue discussing the possibility of using `Query.search` but are unsure if it is officially supported. They mention that their collection has the correct permissions and indexing. They shared their code and mention that it's not working. They ask for assistance in querying their collection to fetch only the documents that contain a specific ID in the 'ids' attribute. There is a suggestion to use `Query.equal('ids', ['id1', 'id2', ...])` and another suggestion to create a separate field named 'search' with a 'fullText' index. There
Binyamin
Aug 28, 2023, 15:53
You can achieve that by creating another field named search and add fullText index to it
Binyamin
Aug 28, 2023, 15:53
Then add all the ID's to that field seperate by space.
Guille
Aug 28, 2023, 15:55
If I understood well you need to create a key index and use Query.equal('ids' ['id1', 'id2', '...'])
Guille
Aug 28, 2023, 15:55
@Binyamin Why you prefer fullText? 🤔
Binyamin
Aug 28, 2023, 15:56
Because I though he also liked to perform a search to find only one ID
Binyamin
Aug 28, 2023, 15:57
If the match looking is for all the IDs together then your solution is the right one.
Guille
Aug 28, 2023, 15:58
Yes, the description is not very clear, lets wait until he clarify what he is looking for
Shubham
Rank 3: Container
Aug 28, 2023, 16:04
Plain text
"title": String ,
"ids": Array[String],
amount: Int
)```
Shubham
Rank 3: Container
Aug 28, 2023, 16:04
so when i pass any id in function , all document that contains this id in ids array should get