Imagine I have a collection of stock data, where there is a "symbol" attribute for each document. In my python function I want to query my collection to return a list of "symbol" attribute values that are unique.
i.e. If I had 3 documents and 2 of the documents had their symbol attribute as "AAPL", and the third document had their symbol attribute as "MSFT", the query would return a list of ["AAPL", "MSFT"]
# Query Database for list of unique symbols
client = (
Client()
.set_endpoint('https://cloud.appwrite.io/v1')
.set_project(PROJECT_ID)
.set_key(APPWRITE_API_KEY)
)
databases = Databases(client)
docs = databases.list_documents(
DATABASE_ID,
COLLECTION_ID,
queries=[
# What queries do I add here?
Query.select(['symbol'])
]
)
Recommended threads
- Get team fail in appwrite function
I try to get team of a user inside appwrite function, but i get this error: `AppwriteException: User (role: guests) missing scope (teams.read)` If i try on cl...
- Function in Node.JS to monitor events ar...
Hello everyone. I'm creating my first Node.JS function, but I don't have much experience with node and javascript. I'm trying to create a function, that monito...
- Edit ID of an existing collection
Hi there. Is it possible to edit an ID of an existing collection? Right now it looks impossible from AppWrite cloud at least.