Inside the document repository you can add a private method, for example:
private function _getNativeConnection(){
$connection = $this->getDocumentManager()->getConnection();
$mongo = $connection->getMongo();
if(!$mongo){
$connection->connect();
$mongo = $connection->getMongo();
}
$db = $mongo->selectDB('YOUR_MONGO_DB')->selectCollection("MONGO_COLLECTION");
return $db;
}
Then you can use it from another repository method, for example:
public function another_public_method{
...
$collection = $this->_getNativeConnection();
...
}
$collection PHP MongoCollection (http://php.net/manual/en/class.mongocollection.php), Mongo ( ),
, , , , ..
, ?