More flexible handling of $doJoin parameter for getCount()