DocumentList response = await databases!.listDocuments( databaseId: "*********", collectionId: "********", queries: [ Query.equal("user_phone_no", phoneNo), Query.orderDesc('$createdAt'), ], ); $createdAt show error, how can I query this, any help
have you created an index?
yes, its format error, it show me red
No the problem is on Query.orderDesc('$createdAt') I tried Query.orderDesc('${createdAt}') flutter consider it as local variable but its from appwrite database ($id, $createdAt, $updatedAt) common fields
queries should be passed as an array
only flutter expert answer me pls queries: [
Query.equal("user_phone_no", phoneNo),
Query.orderDesc('$createdAt'),
],
$createdAt shows red error, format error
what is the error you're getting. show screenshots
also, show your indexes
You need to escape the $ like:
Query.orderDesc('\$createdAt')
Thanks Steven
I spent hours on this syntax issue until I read your response. Thanks so much!
[SOLVED] Query $createdAt
Recommended threads
- Appwrite Auth & Function don't reveal cl...
When I execute a function or sign in with my Flutter app, Appwrite does not show my real IP: instead, it seems that Appwrite shows Fastly CDN IP address.
- Why does this happen?
`AppwriteException: general_argument_invalid, Invalid `secret` param: Value must be a valid string and at least 1 chars and no longer than 256 chars (400)` the...
- Compatibility issue with Kakao OpenID Co...
**Context:** I am attempting to integrate **Kakao Login** (one of the largest social login providers in South Korea) into my Flutter application using Appwrite'...