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
- Update user email using OTP
Hi, I am trying to implement email update using OTP, there is not password associated with the account. One solution I found online is creating appwrite functio...
- RowList: The value of total is coming as...
RowList: The value of total is coming as a String, so it throws an error because it’s not parsed into an int. Error: TypeError: \"37\": type 'String' is not a ...
- [SOLVED] curl error Number: 6 — function...
Hello, I invested a lot of time in this error in a fresh install of appwrite 1.8.1 and lasted until fix, this if for helping anyone that can have the same weird...