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
- Update User Error
```ts const { users, databases } = await createAdminClient(); const session = await getLoggedInUser(); const user = await users.get(session.$id); if (!use...
- Our Appwrite organization is suspended
Please give support regarding this , no app is working now , please solve my issue and give support , no one is replying in message section or email.
- How to Avoid Double Requests in function...
I'm currently using Appwrite's `functions.createExecution` in my project. I want to avoid double requests when multiple actions (like searching or pagination) a...