public function count(array $query = array(), $limitOrOptions = 0, $skip = 0)
    {
        $options = is_array($limitOrOptions)
            ? array_merge(array('limit' => 0, 'skip' => 0), $limitOrOptions)
            : array('limit' => $limitOrOptions, 'skip' => $skip);

        $options['limit'] = (integer) $options['limit'];
        $options['skip'] = (integer) $options['skip'];

        return $this->doCount($query, $options);
    }