What is the best way to get the total size of a ViewFoundSet?
databaseManager.getFoundSetCount() doesn’t support ViewFoundSet.
ViewFoundSet.getSize()will only return a maximum of 200.
I devised a generic method as follows. Is there a better way?
/**
* @param {ViewFoundSet} _vfs
* @return {Number}
* @public
*/
function getViewFoundSetCount(_vfs) {
const _query = _vfs.getQuery();
_query.result.clear().add(_query.aggregates.count());
const _ds = databaseManager.getDataSetByQuery(_query, 1);
return _ds.getMaxRowIndex() ? _ds.getRowAsArray(1)[0] : 0;
}