定義
MongoDB\Model\IndexInfo::isUnique()Return whether the index is a unique index. This correlates with the
uniqueoption forMongoDB\Collection::createIndex().function isUnique(): boolean
Return Values
インデックスが一意なインデックスであるかどうかを示すブール値。
例
$info = new IndexInfo([ 'unique' => true, ]); var_dump($info->isUnique());
出力は次のようになります。
bool(true)
その他の参照
MongoDB マニュアルのlistIndexesコマンド参照
「一意のインデックス」(MongoDB マニュアル)