Back

Documents count

  • 0
  • Flutter
develocode777
22 Sep, 2023, 13:19

It seems that there is a way to get the total number of documents in a collection as shown in picture, how can that be accesed?

TL;DR
The user is asking how to access the total number of documents in a collection from the Appwrite SDKs. They mention that currently, the value of `Total documents` is pulled from the usages collection, but it would be better to access it directly from the SDKs. The user also asks why there is a limit of 5,000 documents when accessing the data. Another user suggests using the `total` attribute in the PHP SDK, which can provide the total number of documents in a collection. Solution: To access the total number of documents in a collection using the PHP SDK, use the `total` attribute when getting
Chris
22 Sep, 2023, 13:31

On php SDK there is an attribute called total when getting a list.

Eg $documents = listdocuments(...); $total = $documents['total'];

D5
22 Sep, 2023, 13:38

That will not get all of them

btme0011
22 Sep, 2023, 13:50
btme0011
22 Sep, 2023, 13:50

its mentioning same thing

btme0011
22 Sep, 2023, 13:51

@D5 why it will not get all of them ?

Chris
22 Sep, 2023, 14:01

And why is that ?

Binyamin
22 Sep, 2023, 14:53

Because you'll be limit to 5k at most.

Binyamin
22 Sep, 2023, 14:57

That value of Total documents is pulled from the usages collection Though it will be nice to access that data from the SDKs.

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