code: protected function prepareFindLastVersion($type, $siteId, $deleted)
      {
          $qa = $this->createAggregationQuery();
          $qa->match(
              array(
                  'siteId' => $siteId,
                  'deleted' => $deleted,
                  'nodeType' => $type
              )
          );
  
          return $this->findLastVersion($qa);
      }
docs: @param string $type
  @param string $siteId
  @param bool   $deleted
  
  @return array
  @throws \Doctrine\ODM\MongoDB\MongoDBException