Back

[SOLVED] why is appwrite skipping documents?

  • 0
  • Databases
mauricev
9 Aug, 2023, 06:32

I have the following function ```Future<models.DocumentList> returnAllTheTanks() async {

TypeScript
List<String>? tankQuery = [
  Query.equal("facility_fk", facilityFk),
];
return await _manageSession.queryDocument(cTankCollection, tankQuery);

} , which is called by models.DocumentList theTankList = await returnAllTheTanks();```I get back a list whose total is 27 items which corresponds to the actual number in the web console, but when I iterate through them, I find the last two documents never make into the list. Why might this be?

TL;DR
The user is experiencing an issue where two documents are being skipped when retrieving data using the Appwrite API. Another user suggests using pagination instead of a hardcoded limit. They provide a link to the Appwrite documentation for pagination and a link to a similar issue on Discord. Solution: Consider using pagination instead of a hardcoded limit when retrieving documents. Documentation on pagination can be found here: [link to documentation].
safwan
9 Aug, 2023, 06:43
safwan
9 Aug, 2023, 06:44

Instead of using a hardcoded value for the limit, consider using pagination.

Pagination reference: https://appwrite.io/docs/databases-pagination

safwan
9 Aug, 2023, 08:11

@mauricev did this fix your issue?

mauricev
9 Aug, 2023, 12:19

Yes

mauricev
9 Aug, 2023, 12:20

thank you

Guille
9 Aug, 2023, 20:52

[SOLVED] why is appwrite skipping documents?

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