public static function groupBy($field)
    {
        if (!(gettype($field)=="string" || $field instanceof Key || $field instanceof Raw)) {
            throw new ClusterpointException("\"->group()\" function: passed field selector is not in valid format.", 9002);
        }
        if ($field instanceof Key) {
            $field =  self::field("{$field}");
        }
        return "{$field}";
    }
public static function groupBy($field)
    {
        if (!(gettype($field)=="string" || $field instanceof Key || $field instanceof Raw)) {
            throw new ClusterpointException("\"->group()\" function: passed field selector is not in valid format.", 9002);
        }
        if ($field instanceof Key) {
            $field =  self::field("{$field}");
        }
        return "{$field}";
    }
public static function groupBy ( $ field ) { if ( ! ( gettype ( $ field ) == "string" || $ field instanceof Key || $ field instanceof Raw ) ) { throw new ClusterpointException ( "\"->group()\" function: passed field selector is not in valid format." , 9002 ) ; } if ( $ field instanceof Key ) { $ field = self :: field ( "{$field}" ) ; } return "{$field}" ; }
Pass back GROUP BY Clause to append the scope.

@param  mixed  $field
@return string
Pass back GROUP BY Clause to append the scope .