code: public function countByPattern($pattern, $redirectionId)
      {
          $qa = $this->createAggregationQuery();
          $qa->match(array(
              'routePattern' => $pattern,
              '_id' => array('$ne' => new \MongoId($redirectionId))
          ));
  
          return $this->countDocumentAggregateQuery($qa);
      }
docs: @param string $pattern
  @param string $redirectionId
  
  @return int