SDK for JS setGroupBy not having expected effect on getObjectCount. Returns incorrect count of objects

The following code returns an object count of 19, where the number of objects that are actually fetched is 18. From my troubleshooting I’ve found that with or without setGroupBy, the result of getObjectCount is 19. Could this be a problem with how setGroupBy works or how I’m using it?

SDK for JS Example:

var whereClause = "(ownerId = 'CF85D4A4-2A77-4F46-99AA-E6BD3A70FD58' OR 'CF85D4A4-2A77-4F46-99AA-E6BD3A70FD58' = permissions.edit.objectId OR 'CF85D4A4-2A77-4F46-99AA-E6BD3A70FD58' = permissions.view.objectId) AND parentDirectory IS null OR (permissions.view.objectId = 'CF85D4A4-2A77-4F46-99AA-E6BD3A70FD58' AND (objectId NOT IN (DirectoryObject[parentDirectory.permissions.view.objectId = 'CF85D4A4-2A77-4F46-99AA-E6BD3A70FD58'].objectId)) AND ownerId != 'CF85D4A4-2A77-4F46-99AA-E6BD3A70FD58')"

var queryBuilder = Backendless.DataQueryBuilder.create()
  .setWhereClause( whereClause )
Backendless.Data.of( "DirectoryObject" ).getObjectCount(queryBuilder)
  .then( function( count ) {
    console.log(count) // prints "19"
  .catch( function( error ) {

var queryBuilder2 = Backendless.DataQueryBuilder.create()
  .setWhereClause( whereClause )
  .then(function(result) {
    console.log(result.length) // prints "18"
  }).catch( function( error ) {

The count should be 18. Using the rest api I get a count of 18, is this a bug on the backendless side?

Rest API Example:

Hello @Tyler_Jacklin,

I was able to reproduce your issue. An internal ticket has been created in order to fix this (BKNDLSS-31259).
We will notify you here once it is fixed.


Hello @Tyler_Jacklin

We’ve just updated cloud servers with a fix for the issue you described above. Could you kindly let us know whether fix works for you well?