Hi I am trying to get data so that i can use a bar chart to display how many times a document with the same "name" attribute exists. However I have realised that for this to work I need to bypass the Query.limit(100) maximum limit since i may need to query up to 500 documents. Is there a way I can implement this where it will still work well in production? or am i just forced to rewrite everything for MongoDB. this is the code i have: ```const getDefaultData = async () => { const res = await databases.listDocuments(databaseID, 'default_data',[ Query.equal('user', [userID]), Query.orderDesc("name"), Query.limit("100") // the default limit is 25 so i have to use this to get all the data but even 100 is not enough ]);
// this gets the count of the items const nameCounts = res.documents.reduce((acc, obj) => { acc[obj.name] = (acc[obj.name] || 0) + 1; return acc; }, {});
const topDefaultData = Object.entries(nameCounts) .sort((a, b) => b[1] - a[1]) .slice(0, 5) .map(([name, count]) => ({ name, count }));
return topDefaultData; }```
Are you using Appwrite Cloud?
No, im hosting it locally on version 1.2.0
You'll need to paginate to get all the data. In 1.3 we removed the max limit
Ok thanks for the help
[SOLVED] Query more than 100 documents to get data
Recommended threads
- Weird permission failure
when creating an account I use following methods: ``` Future<void> register(String email, String password, String username) async { final user = await accoun...
- Paused project can't activate
I have failed to reactivate one my projects which had been paused
- Site deployment keeps getting failed
Hi good folks, need a hand with Sites deploy Error on every deploy: Synchronous function execution timed out... duration doesn't exceed 30 seconds [exact log ...