MongoDB\Model\IndexInfo::isText()
On this page
New in version 1.4.
Definition
MongoDB\Model\IndexInfo::isText()
Return whether the index is a text index.
function isText(): boolean
Return Values
A boolean indicating whether the index is a text index.
Examples
$collection = (new MongoDB\Client)->selectCollection('test', 'restaurants'); $collection->createIndex(['name' => 'text']); foreach ($collection->listIndexes() as $index) { if ($index->isText()) { printf("%s has default language: %d\n", $index->getName(), $index['default_language']); } }
The output would then resemble:
name_text has default language: english
See Also
Text Indexes reference in the MongoDB manual