diff --git a/src/db/ModelQuery.ts b/src/db/ModelQuery.ts index 13c7452..883252c 100644 --- a/src/db/ModelQuery.ts +++ b/src/db/ModelQuery.ts @@ -220,6 +220,7 @@ export default class ModelQuery { this._sortBy = undefined; this._sortDirection = undefined; + this.fields.splice(0, this.fields.length); this.fields.push('COUNT(*)'); let queryResult = await this.execute(connection); return queryResult.results.length;