count method

Future<int> count([
  1. dynamic columns = '*'
])

Retrieve the "count" result of the query.

@param String|List

Implementation

Future<int> count([dynamic columns = '*']) async {
  if (!Utils.is_array(columns)) {
    columns = <String>[columns];
  }
  //var cols = (columns as List).map((e) => e.toString()).toList();

  //__FUNCTION__	The function name, or {closure} for anonymous functions.
  //a constant __FUNCTION__  retorna o nome da corrent função https://www.php.net/manual/en/language.constants.magic.php
  final result = await this.aggregate('count', columns);
  return result is int ? result : 0;
}