So currently I have been trying to get list of documents where I am trying to find a string out of array of strings (attribute in collection). Query.equal("ids", myString) did not work so I tried Query.search("ids", myString) after making a fulltext index but realised search does not work with underscore in the ids. Not sure what to do here ;-;
Summary
The user is having trouble with the Query.search() and Query.equal(). They are unsure if they need to sanitize strings for SQL injection when using Query.search(). They are also wondering if relationship queries will be added in Appwrite 1.4. Another user suggests using the parent ID in the child document to filter children. The user has changed the IDs in the collection to use underscores and regrets it because Query.search() does not work with underscores. They tried using Query.equal() but it also did not work. The solution is to use a different naming convention for IDs or find an alternative method to achieve the desired result.
Infinil
Rank 6: Server
Aug 29, 2023, 11:31
btw Query.search() works fine if there is no underscore or other special characters
Infinil
Rank 6: Server
Aug 29, 2023, 11:31
but the way i have made IDs in collection are with underscore (kinda regretting it now)
Infinil
Rank 6: Server
Aug 29, 2023, 16:59
i changed the IDs.. works now and i dont think it will be possible any other way since its just how fulltext indexes work in maria db 🤔
Infinil
Rank 6: Server
Aug 29, 2023, 17:00
but yea relationship queries will be a game changer here
Drake
Admin
Aug 29, 2023, 17:28
I typically put the parent id in the child document. Then I can filter for children with parent id = XYZ.