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
- MongoDb Database Breaks integer[] & bigi...
I've got a table with the below column created. When I try to insert the value `[-3408048000]` into it, the dart sdk cloud function call is successful (no error...
- Missing Invoice
Hi! I need help with billing on my account (marelu@gmail.com). I have never received a single invoice by email. My organization has been on the Pro plan since...
- Appwrite Functions cold start
Hello. I'm seeing really long cold starts on Appwrite Cloud Functions and wanted to know if this is expected. My function just authenticates the user, fetches ...