Back

Limit in list document?

  • 0
  • Databases
mitsy0_0
20 Dec, 2023, 12:24

What is the limit in result = databases.list_documents('[DATABASE_ID]', '[COLLECTION_ID]') ?

Becasue in my function when I add query, to limit it to 2 its giving results, when when the limit is 25, it gives error

TL;DR
User is receiving an internal curl error when trying to return or log too much data in the appwrite console. The error code is 500. They are using the list documents function in the appwrite python function with a limit of 25. When the limit is reduced to 2, it works without any error. Solution: It is recommended to reduce the limit to a lower number, such as 2, to avoid the error.
jokernifty
20 Dec, 2023, 12:55
TypeScript

const client = new Client()
    .setEndpoint('https://cloud.appwrite.io/v1')
    .setProject('<PROJECT_ID>');

const databases = new Databases(client);

databases.listDocuments(
    '[DATABASE_ID]',
    '[COLLECTION_ID]',
    [
        Query.equal('title', ['Avatar', 'Lord of the Rings']),
        Query.greaterThan('year', 1999)
    ]
);
fafa
20 Dec, 2023, 13:51

If you mean the query "limit", then it should be the max. documents in a list

Kenny
20 Dec, 2023, 14:11

The max limit is 5000, but you should be fine to do Query.limit(25) and have no issue?

mitsy0_0
24 Dec, 2023, 08:55

But I am getting this in appwrite console, for anyhting above 7 in limit (I have some 3000 total documents) An internal curl error has occurred within the executor! Error Msg: Http invalid protocol\nError Code: 500

I am using list documents inside appwrite python function

ideclon
24 Dec, 2023, 17:56

This can happen if you try to return or log too much data.

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more