/** * Retrieves the Collection object. * * @return Collection */ protected function getCollection() : Collection { $conn = $this->connPool->getConnection(); $database = $conn->defaultDatabase; $collection = $this->schema->collection; return $conn->getRawConnection()->{$database}->{$collection}; }
/** * Get the raw MongoDB connection. * * @return \MongoDB\Client */ public function getConnection() { $this->init(); return $this->connectionPool->getConnection()->getRawConnection(); }