const data = (await db.listDocuments(
import.meta.env.VITE_APPWRITE_DATABASE_ID,
import.meta.env.VITE_APPWRITE_COLLECTION_ID,
[Query.equal('userId', [userId])]
)) as unknown as { total: number; documents: UserDocumentProps[] | [] };
return data;
};```
in the console.log() it shows that the number of items is more than 70, but are only getting 25, and i have not limited anything from my side of the code, but i created a new account then uploaded a lot of files, and once it passes 25 the rest doesn't show. So someone help me this problem before i have to go class?
The default limit is 25. See https://appwrite.io/docs/pagination
Okay thank you, but in my use case, can't i make it limitless, becuase the file i been grouped into sections, meaning so making it into pagination means i have to change the design
You should always design with pagination in mind
Okay thank you
[SOLVED] the query only retuns 25 items from the database
For anyone else searching this page into the future, returning and unspecified amount of data from any endpoint is a terrible design choice.
You could accidentally try to return, say, 200 million records (probably in the terabyte range?), essentially DoS attacking your own server, and your own app.
Even if there's no reason for there to be large data set, someone could notice this, and maliciously create data in the collection to cause this issue.
If you revoked create access, and know there will be only 1000 records, for example, then just specify fetching 1000 records.
Recommended threads
- Bandwidth limit for your organization ha...
I received an alert that I exceeded the Free plan bandwidth limit (showing 5.86 GB), but my dashboard tells a different story. The usage stats there are much lo...
- Deploying to Sites will not work. NextJS
It’s been many times I have attempted to deploy to Appwrite and it’s always failed. The deployment itself works, the logs show it works perfectly, however when ...
- custom domain on cloudflair was verified...
I've added the credentials as instructed by the appwrite documentation, with cname set to dns only without proxy, and it successfully validated my domain, and w...