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
- Help
- Realtime: Listener not triggered on upda...
I self host appwrite 1.8.1. The genereal functionallity works fine. But my realtime subscription isn't updating. I see "Received heartbeat response from realtim...
- Impossible to get USER after createEmail...
Am using provider to deal with functions linked to appwrite. Here is my login. Future<String?> login(String email, String password) async { try { aw...