code: public function hasTransition(StatusInterface $fromStatus, StatusInterface $toStatus)
      {
          $qa = $this->createAggregationQuery();
  
          $qa->project(array('transitions' => 1));
          $qa->unwind('$transitions');
          $qa->match(array(
              '$and' => array(
                  array('transitions.statusFrom.$id' => new \MongoId($fromStatus->getId())),
                  array('transitions.statusTo.$id' => new \MongoId($toStatus->getId())),
          )));
  
          return $this->countDocumentAggregateQuery($qa) > 0;
      }
docs: Test is a transition ($fromStatus, $toStatus) exists
  
  @param StatusInterface $fromStatus
  @param StatusInterface $toStatus
  
  @return boolean