I am trying to query my collection Categories. Initially, I tried to query by the documentId, but that yielded no results. I then added an index on $id, that did not help... Now tried to Query on the name attribute... that didnt work either. Not sure what I am doing wrong... Here is the query. TIA
config.db, config.collection.categories, [ Query.equal("$id", ["68432b91003a62bcfab4"]) ] );
config.db, config.collection.categories, [ Query.equal("name", ["Emotional Health"]) ]
Could you provide the response of rhe function?
Also
If you are trying tk fetch a document with its id its better to use getDocument
I am getting an empty array ...
I can try that... not sure why I could not get by "name" either... not sure what I am doing wrong ...
printing categories to the console ...
appreciate your time and willingness to take a look. Thank you!
Could you go to website and select with the name? Like using filter in your collection?
New to app write... not sure what site you are talking about and where to select...
The appwrite website. The page where you see the collection documents
There in filters select the attribute(name) and then equal then put the same value
Querey by "name" works with the value entered ...
Could you provide the code?
Not really sure what is wrong here
try { const { documents, total } = await database.listDocuments( config.db, config.collection.categories, [ Query.equal("name", ["Emotional Health"]) ] ); setCategories(documents); console.log("CATEGORIES RESULT: " + categories); } catch (error) { console.log("ERROR:", error); setError(error); }
the collection has READ permissions for "Any"
That is not the problem. If it was related to this then it would return unauthorized error
Is listdocument without any query returning any document?
i will try
ok... couple of things ... first... not sure why console.log is not displaying anything...
Recommended threads
- MariaDB refuses to connect to appwrite
Earlier, I tried updating my Appwrite version from 18.1.x to the latest release because my Flutter package required it to function properly. I used the official...
- Console display all Databases as TablesD...
While looking at an issue with <@1231860789355347971> we saw that the console was displaying ALL databases as `TablesDB` even if the real type in the API is `le...
- HTTP Error 500 ''
Hello to everyone, I'm a Flutter developer and actually I'm developing an app using Appwrite.. during my tests and also massive ones I've noticed something we...