diff --git a/src/connection.ts b/src/connection.ts index 19341a4156..4c0b36a9e6 100644 --- a/src/connection.ts +++ b/src/connection.ts @@ -277,11 +277,11 @@ export class Connection extends JSForceConnection { .on('record', rec => records.push(rec)) .on('error', err => reject(err)) .on('end', () => { - const totalSize = getNumber(query, 'totalSize') || maxFetch; + const totalSize = getNumber(query, 'totalSize') || 0; if (totalSize > records.length) { process.emitWarning( `The query result is missing ${totalSize - - records.length} records due to a 10,000 limit for performance reasons. Increase the number of records returned by setting the config value "maxQueryLimit" or the environment variable "SFDX_MAX_QUERY_LIMIT" to ${totalSize} or greater than 10,000.` + records.length} records due to a ${maxFetch} record limit. Increase the number of records returned by setting the config value "maxQueryLimit" or the environment variable "SFDX_MAX_QUERY_LIMIT" to ${totalSize} or greater than ${maxFetch}.` ); this._logger.warn( `The query: ${soql} result is missing ${totalSize - records.length} records due to an API limit.`