定义
MongoDB\Model\IndexInfo::isSparse()Return whether the index is a sparse index. This correlates with the
sparseoption forMongoDB\Collection::createIndex().function isSparse(): boolean
Return Values
指示索引是否为稀疏索引的布尔值。
示例
$info = new IndexInfo([ 'sparse' => true, ]); var_dump($info->isSparse());
而输出将类似如下所示:
bool(true)
另请参阅
listIndexes command reference in the MongoDB manual
MongoDB手册中的稀疏索引