Rank 3: Container
for now I use listDocuments, but I only want to get 1 document, which would be easier to use getDocument with Query instead
Votes
0
Replies
24
Participants
Unknown
Messages
25
Rank 3: Container
for now I use listDocuments, but I only want to get 1 document, which would be easier to use getDocument with Query instead
Rank 3: Container
is it even possible?
Admin
GetDocument doesn't take queries 🧐
It does in the docs 😅
Rank 3: Container
Rank 3: Container
ye that's what I'm wondering lol
Admin
Weird...I can't see that...
Admin
Ah, it was added in 1.3. read the description
Admin
@Bill.IHCha :appwriteupvote:
Admin
I meant read the description for what query method is supported
Rank 3: Container
ah, only select?
Rank 3: Container
it would be good to support getDocument with equal query tho?
Admin
Why? It wouldn't really make sense...you're not trying to find a document with getDocument. You want the document with that ID
Rank 3: Container
I have an attribute called user_id, which I want to just get it. which corresponding to discord user id
Admin
You would use list documents then
Rank 3: Container
I do, but I just feel it's better to use getDocument with query, if document doesn't exist it throws an AppwriteException. Right now I have to manually check if there is document.documents[0] everytime to handle all the errors, just doesn't feel right
Admin
Get document is get document by id...
Admin
It's not find one
Rank 3: Container
maybe add new function called getDocumentByQuery?
Rank 3: Container
or findDocument?
Rank 3: Container
into the sdk
Rank 3: Container
that would be great lol
Admin
Feel free to create a feature request
Rank 3: Container
alright
Rank 3: Container
[SOLVED] use Query to get document