버전 1.9부터 더 이상 사용되지 않습니다.
정의
MongoDB\Model\CollectionInfo::getCappedMax()
고정 사이즈 컬렉션 에 대한 문서 제한을 반환합니다. 이는
MongoDB\Database::createCollection()
에 대한max
옵션과 상관 관계가 있습니다.function getCappedMax(): integer|null
Return Values
고정 사이즈 컬렉션 의 문서 제한입니다. 컬렉션 에 제한이 없으면 null
이(가) 반환됩니다.
이 메서드는 MongoDB\Model\CollectionInfo::getOptions()
를 사용하고 max
키에 액세스하는 방식으로 더 이상 사용되지 않습니다.
예시
$db = (new MongoDB\Client)->test; // Creates a capped collection with a document limit of 100 $db->createCollection( 'myCappedCollection', ['capped' => true, 'size' => 1048576, 'max' => 100] ); // Retrieves the document limit for the capped collection foreach ($db->listCollections(['filter' => ['name' => 'myCappedCollection']]) as $info) { var_dump($info->getCappedMax()); }
이 경우 출력은 다음과 유사합니다:
int(100)