Learn the "why" behind slow queries and how to fix them in our 2-Part Webinar.
Register now >
Docs Menu
Docs Home
/ /

MongoDB\Model\IndexInfo::isUnique()

MongoDB\Model\IndexInfo::isUnique()

インデックスが一意なインデックスであるかどうかを返します。 これは、 MongoDB\Collection::createIndex()uniqueオプションと相関します。

function isUnique(): boolean

インデックスが一意なインデックスであるかどうかを示すブール値。

<?php
$info = new IndexInfo([
'unique' => true,
]);
var_dump($info->isUnique());

出力は次のようになります。

bool(true)

戻る

isTtl()

項目一覧