バージョン 1.9 の新機能。
定義
Return Values
コレクションの種類。 これは、 listCollections
コマンドの応答で返されるtype
フィールドに対応します。
例
$db = (new MongoDB\Client)->test; $db->createCollection('myCollection'); // Retrieves the collection type foreach ($db->listCollections(['filter' => ['name' => 'myCollection']]) as $info) { echo $info->getType(); }
出力は次のようになります。
collection
その他の参照
MongoDB マニュアルのlistCollectionsコマンド参照