📜  学说 mongodb 原生查询 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:39.675000             🧑  作者: Mango

代码示例1
/** @var DocumentManager $documentManager */
$documentManager = $this->container
    ->get('doctrine_mongodb')
    ->getManager();

$mongoClient = $documentManager->getConnection()->getMongoClient();

$db = $mongoClient->selectDB('dbname');

$collection = $mongoClient->selectCollection($db, 'collectionName');
$results = $collection->find();