Skip to content

Commit 1ddb2ed

Browse files
committed
Merge pull request #521
2 parents bd7ac9d + 1793da9 commit 1ddb2ed

File tree

4 files changed

+179
-0
lines changed

4 files changed

+179
-0
lines changed

source/reference/enumeration-classes.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,10 @@ Methods
134134
/reference/method/MongoDBModelIndexInfo-getName
135135
/reference/method/MongoDBModelIndexInfo-getNamespace
136136
/reference/method/MongoDBModelIndexInfo-getVersion
137+
/reference/method/MongoDBModelIndexInfo-is2dSphere
138+
/reference/method/MongoDBModelIndexInfo-isGeoHaystack
137139
/reference/method/MongoDBModelIndexInfo-isSparse
140+
/reference/method/MongoDBModelIndexInfo-isText
138141
/reference/method/MongoDBModelIndexInfo-isTtl
139142
/reference/method/MongoDBModelIndexInfo-isUnique
140143

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
=======================================
2+
MongoDB\\Model\\IndexInfo::is2dSphere()
3+
=======================================
4+
5+
.. versionadded:: 1.4
6+
7+
.. default-domain:: mongodb
8+
9+
.. contents:: On this page
10+
:local:
11+
:backlinks: none
12+
:depth: 1
13+
:class: singlecol
14+
15+
Definition
16+
----------
17+
18+
.. phpmethod:: MongoDB\\Model\\IndexInfo::is2dSphere()
19+
20+
Return whether the index is a :manual:`2dsphere </core/2dsphere>`
21+
index.
22+
23+
.. code-block:: php
24+
25+
function is2dSphere(): boolean
26+
27+
Return Values
28+
-------------
29+
30+
A boolean indicating whether the index is a 2dsphere index.
31+
32+
Examples
33+
--------
34+
35+
.. code-block:: php
36+
37+
<?php
38+
39+
$collection = (new MongoDB\Client)->selectCollection('test', 'places');
40+
41+
$collection->createIndex(['pos' => '2dsphere']);
42+
43+
foreach ($collection->listIndexes() as $index) {
44+
if ($index->is2dSphere()) {
45+
printf("%s has 2dsphereIndexVersion: %d\n", $index->getName(), $index['2dsphereIndexVersion']);
46+
}
47+
}
48+
49+
The output would then resemble::
50+
51+
pos_2dsphere has 2dsphereIndexVersion: 3
52+
53+
See Also
54+
--------
55+
56+
- :phpmethod:`MongoDB\\Collection::createIndex()`
57+
- :phpmethod:`MongoDB\\Collection::listIndexes()`
58+
- :manual:`2dsphere Indexes </core/2dsphere>` reference in the MongoDB
59+
manual
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
==========================================
2+
MongoDB\\Model\\IndexInfo::isGeoHaystack()
3+
==========================================
4+
5+
.. versionadded:: 1.4
6+
7+
.. default-domain:: mongodb
8+
9+
.. contents:: On this page
10+
:local:
11+
:backlinks: none
12+
:depth: 1
13+
:class: singlecol
14+
15+
Definition
16+
----------
17+
18+
.. phpmethod:: MongoDB\\Model\\IndexInfo::isGeoHaystack()
19+
20+
Return whether the index is a :manual:`geoHaystack
21+
</core/geohaystack>` index.
22+
23+
.. code-block:: php
24+
25+
function isGeoHaystack(): boolean
26+
27+
Return Values
28+
-------------
29+
30+
A boolean indicating whether the index is a geoHaystack index.
31+
32+
Examples
33+
--------
34+
35+
.. code-block:: php
36+
37+
<?php
38+
39+
$collection = (new MongoDB\Client)->selectCollection('test', 'places');
40+
41+
$collection->createIndex(['pos' => 'geoHaystack', 'x' => 1], ['bucketSize' => 5]);
42+
43+
foreach ($collection->listIndexes() as $index) {
44+
if ($index->isGeoHaystack()) {
45+
printf("%s has bucketSize: %d\n", $index->getName(), $index['bucketSize']);
46+
}
47+
}
48+
49+
The output would then resemble::
50+
51+
pos_geoHaystack_x_1 has bucketSize: 5
52+
53+
See Also
54+
--------
55+
56+
- :phpmethod:`MongoDB\\Collection::createIndex()`
57+
- :phpmethod:`MongoDB\\Collection::listIndexes()`
58+
- :manual:`geoHaystack Indexes </core/geohaystack>` reference in the MongoDB
59+
manual
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
===================================
2+
MongoDB\\Model\\IndexInfo::isText()
3+
===================================
4+
5+
.. versionadded:: 1.4
6+
7+
.. default-domain:: mongodb
8+
9+
.. contents:: On this page
10+
:local:
11+
:backlinks: none
12+
:depth: 1
13+
:class: singlecol
14+
15+
Definition
16+
----------
17+
18+
.. phpmethod:: MongoDB\\Model\\IndexInfo::isText()
19+
20+
Return whether the index is a :manual:`text </core/index-text>` index.
21+
22+
.. code-block:: php
23+
24+
function isText(): boolean
25+
26+
Return Values
27+
-------------
28+
29+
A boolean indicating whether the index is a text index.
30+
31+
Examples
32+
--------
33+
34+
.. code-block:: php
35+
36+
<?php
37+
38+
$collection = (new MongoDB\Client)->selectCollection('test', 'restaurants');
39+
40+
$collection->createIndex(['name' => 'text']);
41+
42+
foreach ($collection->listIndexes() as $index) {
43+
if ($index->isText()) {
44+
printf("%s has default language: %d\n", $index->getName(), $index['default_language']);
45+
}
46+
}
47+
48+
The output would then resemble::
49+
50+
name_text has default language: english
51+
52+
See Also
53+
--------
54+
55+
- :phpmethod:`MongoDB\\Collection::createIndex()`
56+
- :phpmethod:`MongoDB\\Collection::listIndexes()`
57+
- :manual:`Text Indexes </core/index-text>` reference in the MongoDB
58+
manual

0 commit comments

Comments
 (0)