
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
- [SOLVED] Access ExecutionStatus of a fun...
I am calling a cloud function from the newest Flutter SDK 20.2.1with the `xasync: false` flag and get the result, but the `execution.status` is not a String and...
- Appwrite isn't accepting the api from se...
Error creating user: AppwriteException: Server Error type: 'general_unknown', response: '{"message":"Server Error","code":500,"type":"general_unknown","versi...
- Subject: Request for temporary quota lif...
Hi Appwrite Team, our nonprofit animal rescue app on Appwrite Cloud is currently throttled due to read‑quota limits, and we need a temporary increase so rescue ...
