How can I randomly retrieve one document from a collection without fetching all documents?
- 0
- Databases
- Web
hey guys i made a appwrite database and i add my documents with relevant attributes in a collection, now is there any way to get randomly one of the document in a collection like without fetching all the documents id and then select one of the document. like it made the process slower if the no. of documents is many
This feature is not yet implemented
You might wanna upvote this issue
so i have to first retreive all the documents, then randomly get one, right?
Yes
sad
Also there's some work around
upvote done
Check this
Meaning you add another counter ID and randomly select it It's a bit tricky, but should work
also, what is the maximum limit to get documents?, its 100?
Now you can go up to 5K
ok 5k will be enough for me
thanks
Recommended threads
- Query Appwrite
Hello, I have a question regarding Queries in Appwrite. If I have a string "YYYY-MM", how can I query the $createdAt column to match this filter?
- Different appwrite IDs are getting expos...
File_URL_FORMAT= https://cloud.appwrite.io/v1/storage/buckets/[BUCKET_ID]/files/[FILE_ID]/preview?project=[PROJECT_ID] I'm trying to access files in my web app...
- Invalid document structure: missing requ...
I just pick up my code that's working a week ago, and now I got this error: ``` code: 400, type: 'document_invalid_structure', response: { message: 'Inv...