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
- Current User is Not authorized
recreating same Thread
- Apple OAuth Scopes
Hi Hi, I've configured sign in with apple and this is the response i'm getting from apple once i've signed in. I cant find anywhere I set scopes. I remember se...
- Sign In With Apple OAuth Help
Hi All! I've got a flutter & appwrite app which Im trying to use sign in with apple for. I already have sign in with google working and the function is the sam...