Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Docs Menu
Docs Home
/ / /
PHP Library Manual
/ / /

MongoDB\Model\IndexInfo::isSparse()

MongoDB\Model\IndexInfo::isSparse()

Return whether the index is a sparse index. This correlates with the sparse option for MongoDB\Collection::createIndex().

function isSparse(): boolean

A boolean indicating whether the index is a sparse index.

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

The output would then resemble:

bool(true)

Back

is2dSphere()

On this page