定义
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)
另请参阅
listIndexes command reference in the MongoDB manual
MongoDB手册中的唯一索引