if (keyword) {
setLoading(true);
databases
.listDocuments(
import.meta.env.VITE_PUBLIC_DATABASE_ID,
import.meta.env.VITE_PUBLIC_COLLECTION_ID,
[
Query.search("title", keyword),
Query.orderDesc("$createdAt"),
]
)
.then((response) => {
setCrafts(response.documents);
console.log(response.documents);
})
.catch((error) => {
console.error("Failed to fetch user crafts:", error);
});
setLoading(false);
}
}, [keyword]);```
I have 2 different attributes title, description
so how i can query both at the same time
It sounds like you want to have a logical OR which isn't supported at the moment. Make sure to 👍 this issue: https://github.com/appwrite/appwrite/issues/2740
I would recommend creating an attribute containing all the text you want to search across and then use that in your query
Recommended threads
- Different appwrite IDs are getting expos...
File_URL_FORMAT= https://cloud.appwrite.io/v1/storage/buckets/[BUCKET_ID]/files/[FILE_ID]/preview?project=[PROJECT_ID] I'm trying to access files in my web app...
- Invalid document structure: missing requ...
I just pick up my code that's working a week ago, and now I got this error: ``` code: 400, type: 'document_invalid_structure', response: { message: 'Inv...
- custom domain with CloudFlare
Hi all, it seems that CloudFlare has blocked cross-domain CNAME link which made my app hostname which is in CloudFlare, unable to create a CNAME pointing to clo...