Skip to content
Back

total parameter not working correctly in listRows() (Node.js & Dart SDKs)

  • 0
  • Flutter
  • Web
  • Databases
  • Cloud
  • Functions
Egor Tabula
27 Dec, 2025, 13:31

Hello Appwrite team,

I'm experiencing issues with the total parameter in the listRows() method (TablesDB) across multiple SDKs.

Issue 1: Node.js SDK (node-appwrite: ^21.1.0)

The total parameter doesn't affect the response as expected. According to the documentation, when total: false, the response should return total: 0. However, I'm getting the actual count regardless of the parameter value.

TypeScript
// Both calls return the same result (e.g., total: 700)
const response1 = await tables.listRows({
  databaseId: 'main',
  tableId: 'users',
  queries: [sdk.Query.limit(1)],
  total: true,  // Returns total: 700
});

const response2 = await tables.listRows({
  databaseId: 'main',
  tableId: 'users',
  queries: [sdk.Query.limit(1)],
  total: false,  // Also returns total: 700, expected: 0
});

Issue 2: Dart SDK (dart_appwrite: 20.1.0)

When trying to use the total parameter in Dart cloud functions, I get a type error:

type 'bool' is not a subtype of type 'Iterable<dynamic>'

Could you please investigate this issue?

Thank you!

TL;DR
Issue: Developers experiencing problems with the total parameter in listRows() method across Node.js and Dart SDKs. Solution: - In Node.js SDK: The total parameter does not affect the response as expected. Regardless of the value (true/false), the actual count is returned. This issue is possibly a bug and needs further investigation by the Appwrite team. - In Dart SDK: Developers are encountering a type error - 'bool' is not a subtype of type 'Iterable<dynamic>' when using the total parameter in Dart cloud functions. This issue requires investigation and resolution by the Appwrite team.
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