-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🚀 Feature: add new function called findDocument() to find a document by query #57
Labels
enhancement
New feature or request
Comments
maybe something like /**
* List Documents
* Get the first user's documents in a given collection using queries to filter your results.
* @param databaseId
* @param collectionId
* @param queries
* @throws — {AppwriteException}
*/
findDocument<Document extends Models.Document>(
databaseId: string,
collectionId: string,
queries: string[],
): Promise<Document> {
return new Promise((resolve, reject) => {
this.listDocuments(databaseId, collectionId, queries)
.then((document) => {
if (document.documents[0]) resolve(document.documents[0]);
else throw new AppwriteException('No document found');
})
.catch(reject);
});
} |
Hi I will keep this issue open as of now since we are very keen in considering feedbacks from our community |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🔖 Feature description
Add a new function in the Database SDK called findDocument which uses listDocument to get the first returned document with Query.
🎤 Pitch
This feature can be used if you have an id for attitude such as a user_id attribute and don't want it to be the same as the document id.
👀 Have you spent some time to check if this issue has been raised before?
🏢 Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: