Skip to content
Back

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

  • 0
  • 3
  • 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 found with the total parameter in listRows() using both Node.js and Dart SDKs. Problem lies in the client_mixin.dart file. The bool value isn't filtered causing a type mismatch for the Uri parameter. Reported on GitHub for solution.
V
29 Dec, 2025, 19:53

I just noticed this issue too.

TypeScript
appwrite-20.3.2/lib/src/client_mixin.dart
} else if (method == HttpMethod.get) {
      if (params.isNotEmpty) {
        Map<String, dynamic> filteredParams = {};
        params.forEach((key, value) {
          if (value != null) {
            if (value is int || value is double) {
              filteredParams[key] = value.toString();
            } else if (value is List) {
              filteredParams["$key[]"] = value;
            } else {
              filteredParams[key] = value;
            }
          }
        });
        params = filteredParams;
      }
      uri = Uri(
        fragment: uri.fragment,
        path: uri.path,
        host: uri.host,
        scheme: uri.scheme,
        queryParameters: params,
        port: uri.port,
      );```
This part causes it. The bool doesnt get filtered and Uri expects a String?|Iterable<String> and throws
9 Jan, 2026, 17:47

Hi, just to let you know I've encountered the same issue with the flutter SDK and I've created the following issue on Github: https://github.com/appwrite/sdk-for-flutter/issues/292

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