Issue when using Query.equal in an appwrite function using python
- 2
- Databases
- Flutter
- Functions
- Cloud
Recently I faced an issue while executing the below function to generate a unique referralCode.
`from random import Random from appwrite.services.databases import Databases from appwrite.query import Query
def generateReferralCode(client)->str: databases = Databases(client) docs = { 'total': 1, } referralCode = None while (docs['total'] > 0): referralCode = Random().randint(100000, 999999) docs = databases.list_documents('USER_DATA', 'USERDATA', [ Query.equal('referralCode', referralCode) ]) return referralCode`
It shows me this error: Invalid query: {"method":"equal","attribute":"referralCode","values":["300522"]}
my collection has the following attributes:
name: String referralCode: Integer
This code used to work fine when I wrote it a few days ago, but now it throws an error.
Recommended threads
- Bulk API limitations in self-hosted serv...
Environment: Appwrite Selfhost SDK: node-appwrite 28.0 Calling `upsertRows` (also applies to `createRows`/`updateRows`/`deleteRows`) with more than 100 rows fa...
- Android SDK: Kotlin null Value Not Updat...
Hi team, I think you should check the Android SDK implementation once, as it seems to have an issue handling Kotlin **null** values. For example: When I send:...
- Can't connect GitHub — 500 error at the ...
Appwrite Cloud, Pro plan, SFO region. All my Git connections vanished today — Sites and all 15 Functions now show no repository connected. When I try to add a ...