Docs Menu
Docs Home
/ / /
PHP 라이브러리 매뉴얼
/ / /

MongoDB\Model\CollectionInfo::getInfo()

버전 1.9에 새로 추가되었습니다.

MongoDB\Model\CollectionInfo::getInfo()

collection에 대한 추가 정보를 반환합니다.

function getInfo(): array

collection에 대한 추가 정보가 포함된 배열입니다. 이는 listCollections 명령 회신에서 반환된 info 필드에 해당합니다.

<?php
$db = (new MongoDB\Client)->test;
// Creates a view with the readOnly option set to "true"
$db->createCollection(
'myView',
['viewOn' => 'myCollection'],
['readOnly' => true]
);
// Retrieves information about the collection view
foreach ($db->listCollections(['filter' => ['name' => 'myView']]) as $info) {
var_dump($info->getInfo());
}

이 경우 출력은 다음과 유사합니다:

array(1) {
["readOnly"]=>
bool(true)
}
  • MongoDB\Database::createCollection()

  • MongoDB 매뉴얼의 listCollections 명령 참조

돌아가기

getIdIndex()

이 페이지의 내용