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
- One to many 2 way, console UI not correc...
Hey, seems I'm facing the exactly same issue with this one: https://github.com/appwrite/appwrite/issues/6016 Since this Github issue stay open for so long, let ...
- Server Down
Appwrite services are down. When will they start working again?
- Scheduled works locking the entire Maria...
I have a scheduled function and apparently that or something is locking the entire MariaDB database and Appwrite is giving MariaDB errors. This error persists e...