From 3cae05879305c8b3b0f26be4291f35f422db0d0b Mon Sep 17 00:00:00 2001 From: rustagir Date: Thu, 5 Sep 2024 15:52:23 -0400 Subject: [PATCH 1/9] DOCSP-41983: indexes landing pg --- .../usage-examples/index-code-examples.php | 79 ++++++ .../usage-examples/sample-app-intro.rst | 10 + source/includes/usage-examples/sample-app.php | 12 + source/index.txt | 1 + source/indexes.txt | 260 ++++++++++++++++++ 5 files changed, 362 insertions(+) create mode 100644 source/includes/usage-examples/index-code-examples.php create mode 100644 source/includes/usage-examples/sample-app-intro.rst create mode 100644 source/includes/usage-examples/sample-app.php create mode 100644 source/indexes.txt diff --git a/source/includes/usage-examples/index-code-examples.php b/source/includes/usage-examples/index-code-examples.php new file mode 100644 index 00000000..5dcae071 --- /dev/null +++ b/source/includes/usage-examples/index-code-examples.php @@ -0,0 +1,79 @@ +'); +$collection = $client->->; + +// start-single-field +$result = $collection->createIndex(['' => 1]); +// end-single-field + +// start-compound +$indexName = $collection->createIndex( + ['' => 1, '' => 1] +); +// end-compound + +// start-multikey +$result = $collection->createIndex(['' => 1]); +// end-multikey + +// start-search-create +$result = $collection->createSearchIndex( + ['mappings' => ['dynamic' => true]], + ['name' => ''] +); +// end-search-create + +// start-search-list +foreach ($collection->listIndexes() as $indexInfo) { + var_dump($indexInfo); +} +// end-search-list + +// start-search-update +$result = $collection->updateSearchIndex( + ['name' => ''], + ['mappings' => ['dynamic' => true]], + ); +// end-search-update + +// start-search-delete +$result = $collection->dropIndex(''); +// end-search-delete + +// start-text +$result = $collection->createIndex(['' => 'text']); +// end-text + +// start-geo +$result = $collection->createIndex( + [ '' => '2dsphere'], ['name' => ''] +); +// end-geo + +// start-unique +$result = $collection->createIndex(['' => 1], ['unique' => true]); +// end-unique + +// start-wildcard +$result = $collection->createIndex(['$**' => 1]); +// end-wildcard + +// start-clustered +$options = [ + 'clusteredIndex' => [ + 'key' => ['_id' => 1], + 'unique' => true + ] +]; + +$database->createCollection('', $options); +// end-clustered + +// start-remove +$result = $collection->dropIndex(''); +// end-remove \ No newline at end of file diff --git a/source/includes/usage-examples/sample-app-intro.rst b/source/includes/usage-examples/sample-app-intro.rst new file mode 100644 index 00000000..cee5f2d7 --- /dev/null +++ b/source/includes/usage-examples/sample-app-intro.rst @@ -0,0 +1,10 @@ +Sample Application +~~~~~~~~~~~~~~~~~~ + +You can use the following sample application to test the code examples on this +page. To use the sample application, perform the following steps: + +1. Ensure you have the {+php-library+} installed in your project. +#. Copy the following code and paste it into a new ``.php`` file. +#. Copy a code example from this page and paste it on the specified + lines in the file. diff --git a/source/includes/usage-examples/sample-app.php b/source/includes/usage-examples/sample-app.php new file mode 100644 index 00000000..140b2b2b --- /dev/null +++ b/source/includes/usage-examples/sample-app.php @@ -0,0 +1,12 @@ +'); +$collection = $client->->; + +// Start example code here + +// End example code here diff --git a/source/index.txt b/source/index.txt index 72d8b53b..b4b4841a 100644 --- a/source/index.txt +++ b/source/index.txt @@ -14,6 +14,7 @@ MongoDB PHP Library /read /write /aggregation + /indexes /tutorial /upgrade /reference diff --git a/source/indexes.txt b/source/indexes.txt new file mode 100644 index 00000000..f41bcf6e --- /dev/null +++ b/source/indexes.txt @@ -0,0 +1,260 @@ +.. _php-indexes: + +================================= +Optimize Queries by Using Indexes +================================= + +.. contents:: On this page + :local: + :backlinks: none + :depth: 2 + :class: singlecol + +.. facet:: + :name: genre + :values: reference + +.. meta:: + :description: Learn how to use indexes by using the MongoDB PHP Library. + :keywords: query, optimization, efficiency, usage example, code example + +.. .. toctree:: +.. :titlesonly: +.. :maxdepth: 1 +.. +.. /work-with-indexes + +Overview +-------- + +On this page, you can see copyable code examples that show how to manage +different types of indexes by using the {+php-library+}. + +.. .. tip:: +.. +.. To learn more about working with indexes, see the :ref:`php-work-indexes` +.. guide. To learn more about any of the indexes shown on this page, see the link +.. provided in each section. + +To use an example from this page, copy the code example into the +:ref:`sample application ` or your own application. +Be sure to replace all placeholders in the code examples, such as +````, with the relevant values for your MongoDB +deployment. + +.. _php-index-sample: + +.. include:: /includes/usage-examples/sample-app-intro.rst + +.. literalinclude:: /includes/usage-examples/sample-app.php + :language: php + :copyable: + :linenos: + :emphasize-lines: 10-12 + +Single Field Index +------------------ + +The following example creates an ascending index on the specified field: + +.. literalinclude:: /includes/usage-examples/index-code-examples.php + :start-after: start-single-field + :end-before: end-single-field + :language: php + :copyable: + :dedent: + +.. To learn more about single field indexes, see the +.. :ref:`php-single-field-index` guide. + +Compound Index +-------------- + +The following example creates a compound index on the specified fields: + +.. literalinclude:: /includes/usage-examples/index-code-examples.php + :start-after: start-compound + :end-before: end-compound + :language: php + :copyable: + :dedent: + +.. To learn more about compound indexes, see the :ref:`php-compound-index` guide. + +Multikey Index +-------------- + +The following example creates a multikey index on the specified array-valued field: + +.. literalinclude:: /includes/usage-examples/index-code-examples.php + :start-after: start-multikey + :end-before: end-multikey + :language: php + :copyable: + :dedent: + +.. TODO To learn more about multikey indexes, see the :ref:`php-multikey-index` +.. guide. + +Geospatial Index +---------------- + +The following example creates a 2dsphere index on the specified field +that has GeoJSON object values: + +.. literalinclude:: /includes/usage-examples/index-code-examples.php + :start-after: start-geo + :end-before: end-geo + :language: php + :copyable: + :dedent: + +.. TODO: To learn more about geospatial indexes, see the :ref:`php-geospatial-index` +.. guide. + +Unique Index +------------ + +The following example creates a unique index on the specified field: + +.. literalinclude:: /includes/usage-examples/index-code-examples.php + :start-after: start-unique + :end-before: end-unique + :language: php + :copyable: + :dedent: + +.. TODO: To learn more about unique indexes, see the :ref:`php-unique-index` +.. guide. + +Wildcard Index +-------------- + +The following example creates a wildcard index in the specified collection: + +.. literalinclude:: /includes/usage-examples/index-code-examples.php + :start-after: start-wildcard + :end-before: end-wildcard + :language: php + :copyable: + :dedent: + +.. TODO: To learn more about wildcard indexes, see the :ref:`php-wildcard-index` +.. guide. + +Clustered Index +--------------- + +You can create a clustered index when creating a new collection in a +specified database. The following example creates a new collection with a +clustered index on the ``_id`` field: + +.. literalinclude:: /includes/usage-examples/index-code-examples.php + :start-after: start-clustered + :end-before: end-clustered + :language: php + :copyable: + :dedent: + +.. TODO: To learn more about clustered indexes, see the :ref:`php-clustered-index` +.. guide. + +Atlas Search Index Management +----------------------------- + +The following sections contain code examples that describe how to manage +:atlas:`Atlas Search indexes `. + +.. To learn more about Atlas Search indexes, see the :ref:`php-atlas-search-index` +.. guide. + +Create Search Index +~~~~~~~~~~~~~~~~~~~ + +The following example creates an Atlas Search index on the specified field: + +.. literalinclude:: /includes/usage-examples/index-code-examples.php + :start-after: start-search-create + :end-before: end-search-create + :language: php + :copyable: + :dedent: + +.. To learn more about creating search indexes, see the +.. :ref:`php-atlas-search-index-create` guide. + +List Search Indexes +~~~~~~~~~~~~~~~~~~~ + +The following example prints a list of Atlas Search indexes in the specified collection: + +.. literalinclude:: /includes/usage-examples/index-code-examples.php + :start-after: start-search-list + :end-before: end-search-list + :language: php + :copyable: + :dedent: + +.. To learn more about listing search indexes, see the :ref:`php-atlas-search-index-list` +.. guide. + +Update Search Indexes +~~~~~~~~~~~~~~~~~~~~~ + +The following example updates an existing Atlas Search index with the specified +new index definition: + +.. literalinclude:: /includes/usage-examples/index-code-examples.php + :start-after: start-search-update + :end-before: end-search-update + :language: php + :copyable: + :dedent: + +.. To learn more about updating search indexes, see the :ref:`php-atlas-search-index-update` +.. guide. + +Delete Search Indexes +~~~~~~~~~~~~~~~~~~~~~ + +The following example deletes an Atlas Search index with the specified name: + +.. literalinclude:: /includes/usage-examples/index-code-examples.php + :start-after: start-search-delete + :end-before: end-search-delete + :language: php + :copyable: + :dedent: + +.. To learn more about deleting search indexes, see the :ref:`php-atlas-search-index-drop` +.. guide. + +Text Index +---------- + +The following example creates a text index on the specified string field: + +.. literalinclude:: /includes/usage-examples/index-code-examples.php + :start-after: start-text + :end-before: end-text + :language: php + :copyable: + :dedent: + +.. TODO: To learn more about text indexes, see the :ref:`php-text-index` +.. guide. + +Delete an Index +--------------- + +The following example deletes an index with the specified name: + +.. literalinclude:: /includes/usage-examples/index-code-examples.php + :start-after: start-remove + :end-before: end-remove + :language: php + :copyable: + :dedent: + +.. TODO: To learn more about removing indexes, see :ref:`php-indexes-remove` +.. in the Work with Indexes guide. \ No newline at end of file From d65dae93072c699b4ec33c813d7e25e3e3fe021b Mon Sep 17 00:00:00 2001 From: rustagir Date: Thu, 5 Sep 2024 15:58:23 -0400 Subject: [PATCH 2/9] wip --- .../usage-examples/index-code-examples.php | 8 +++++++- source/indexes.txt | 16 +++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/source/includes/usage-examples/index-code-examples.php b/source/includes/usage-examples/index-code-examples.php index 5dcae071..c767d55c 100644 --- a/source/includes/usage-examples/index-code-examples.php +++ b/source/includes/usage-examples/index-code-examples.php @@ -29,7 +29,7 @@ // end-search-create // start-search-list -foreach ($collection->listIndexes() as $indexInfo) { +foreach ($collection->listSearchIndexes() as $indexInfo) { var_dump($indexInfo); } // end-search-list @@ -74,6 +74,12 @@ $database->createCollection('', $options); // end-clustered +// start-list +foreach ($collection->listIndexes() as $indexInfo) { + var_dump($indexInfo); +} +// end-list + // start-remove $result = $collection->dropIndex(''); // end-remove \ No newline at end of file diff --git a/source/indexes.txt b/source/indexes.txt index f41bcf6e..4c8c0c66 100644 --- a/source/indexes.txt +++ b/source/indexes.txt @@ -186,7 +186,8 @@ The following example creates an Atlas Search index on the specified field: List Search Indexes ~~~~~~~~~~~~~~~~~~~ -The following example prints a list of Atlas Search indexes in the specified collection: +The following example prints a list of Atlas Search indexes in the +specified collection: .. literalinclude:: /includes/usage-examples/index-code-examples.php :start-after: start-search-list @@ -244,6 +245,19 @@ The following example creates a text index on the specified string field: .. TODO: To learn more about text indexes, see the :ref:`php-text-index` .. guide. +List Indexes +------------ + +The following example prints a list indexes in the +specified collection: + +.. literalinclude:: /includes/usage-examples/index-code-examples.php + :start-after: start-list + :end-before: end-list + :language: php + :copyable: + :dedent: + Delete an Index --------------- From 2477f397db551f496c26e874714c056e750b2c69 Mon Sep 17 00:00:00 2001 From: rustagir Date: Thu, 5 Sep 2024 15:59:11 -0400 Subject: [PATCH 3/9] wip --- source/indexes.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/indexes.txt b/source/indexes.txt index 4c8c0c66..de22313e 100644 --- a/source/indexes.txt +++ b/source/indexes.txt @@ -248,7 +248,7 @@ The following example creates a text index on the specified string field: List Indexes ------------ -The following example prints a list indexes in the +The following example prints a list of indexes in the specified collection: .. literalinclude:: /includes/usage-examples/index-code-examples.php From 4abb6ded78be56c9b7d2c2706ef7fa6e7523f086 Mon Sep 17 00:00:00 2001 From: rustagir Date: Fri, 6 Sep 2024 10:52:04 -0400 Subject: [PATCH 4/9] MM PR fixes 1 --- source/indexes.txt | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/source/indexes.txt b/source/indexes.txt index de22313e..349cab82 100644 --- a/source/indexes.txt +++ b/source/indexes.txt @@ -70,7 +70,8 @@ The following example creates an ascending index on the specified field: Compound Index -------------- -The following example creates a compound index on the specified fields: +The following example creates a compound index of two ascending indexes +on the specified fields: .. literalinclude:: /includes/usage-examples/index-code-examples.php :start-after: start-compound @@ -84,7 +85,8 @@ The following example creates a compound index on the specified fields: Multikey Index -------------- -The following example creates a multikey index on the specified array-valued field: +The following example creates an ascending multikey index on the +specified array-valued field: .. literalinclude:: /includes/usage-examples/index-code-examples.php :start-after: start-multikey @@ -115,7 +117,8 @@ that has GeoJSON object values: Unique Index ------------ -The following example creates a unique index on the specified field: +The following example creates an ascending unique index on the specified +field: .. literalinclude:: /includes/usage-examples/index-code-examples.php :start-after: start-unique @@ -130,7 +133,8 @@ The following example creates a unique index on the specified field: Wildcard Index -------------- -The following example creates a wildcard index in the specified collection: +The following example creates an ascending wildcard index on the +collection: .. literalinclude:: /includes/usage-examples/index-code-examples.php :start-after: start-wildcard @@ -146,8 +150,8 @@ Clustered Index --------------- You can create a clustered index when creating a new collection in a -specified database. The following example creates a new collection with a -clustered index on the ``_id`` field: +specified database. The following example creates a new collection with an +ascending clustered index on the ``_id`` field: .. literalinclude:: /includes/usage-examples/index-code-examples.php :start-after: start-clustered From e227a7fdb3b62954dc39819fb5a0c0ef8096606a Mon Sep 17 00:00:00 2001 From: rustagir Date: Tue, 10 Sep 2024 10:29:42 -0400 Subject: [PATCH 5/9] JM tech review 1 --- source/includes/usage-examples/sample-app.php | 6 +++--- source/indexes.txt | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/source/includes/usage-examples/sample-app.php b/source/includes/usage-examples/sample-app.php index 140b2b2b..f9d2cb83 100644 --- a/source/includes/usage-examples/sample-app.php +++ b/source/includes/usage-examples/sample-app.php @@ -2,10 +2,10 @@ require __DIR__ . '/../vendor/autoload.php'; -use MongoDB\Client; +$uri = getenv('MONGODB_URI') ?: throw new RuntimeException('Set the MONGODB_URI variable to your Atlas URI that connects to the sample dataset'); +$client = new MongoDB\Client($uri); -$client = new Client(''); -$collection = $client->->; +$collection = $client->selectCollection('', ''); // Start example code here diff --git a/source/indexes.txt b/source/indexes.txt index 349cab82..b1c3155d 100644 --- a/source/indexes.txt +++ b/source/indexes.txt @@ -38,9 +38,10 @@ different types of indexes by using the {+php-library+}. To use an example from this page, copy the code example into the :ref:`sample application ` or your own application. -Be sure to replace all placeholders in the code examples, such as -````, with the relevant values for your MongoDB -deployment. +Make sure to set the ``MONGODB_URI`` environment variable to the +connection string for your MongoDB deployment, and replace the +```` and ```` placeholders with values for your +target namespace. .. _php-index-sample: From b18b221e2708f84844e20b871f8efc93a4e5f656 Mon Sep 17 00:00:00 2001 From: rustagir Date: Tue, 10 Sep 2024 11:02:34 -0400 Subject: [PATCH 6/9] JM tech review 1 --- .../usage-examples/index-code-examples.php | 52 ++++++--- source/indexes.txt | 108 +++++++++++------- 2 files changed, 98 insertions(+), 62 deletions(-) diff --git a/source/includes/usage-examples/index-code-examples.php b/source/includes/usage-examples/index-code-examples.php index c767d55c..0bea50b0 100644 --- a/source/includes/usage-examples/index-code-examples.php +++ b/source/includes/usage-examples/index-code-examples.php @@ -2,13 +2,21 @@ require __DIR__ . '/../vendor/autoload.php'; -use MongoDB\Client; +$uri = getenv('MONGODB_URI') ?: throw new RuntimeException('Set the MONGODB_URI variable to your Atlas URI that connects to the sample dataset'); +$client = new MongoDB\Client($uri); -$client = new Client(''); -$collection = $client->->; +$database = $client->sample_db; +$collection = $database->sample_coll; + +// start-to-json +function toJSON(object $document): string +{ + return MongoDB\BSON\Document::fromPHP($document)->toRelaxedExtendedJSON(); +} +// end-to-json // start-single-field -$result = $collection->createIndex(['' => 1]); +$indexName = $collection->createIndex(['' => 1]); // end-single-field // start-compound @@ -18,11 +26,11 @@ // end-compound // start-multikey -$result = $collection->createIndex(['' => 1]); +$indexName = $collection->createIndex(['' => 1]); // end-multikey // start-search-create -$result = $collection->createSearchIndex( +$indexName = $collection->createSearchIndex( ['mappings' => ['dynamic' => true]], ['name' => ''] ); @@ -30,37 +38,45 @@ // start-search-list foreach ($collection->listSearchIndexes() as $indexInfo) { - var_dump($indexInfo); + echo toJSON($indexInfo) . PHP_EOL; } // end-search-list // start-search-update -$result = $collection->updateSearchIndex( - ['name' => ''], - ['mappings' => ['dynamic' => true]], +$collection->updateSearchIndex( + ['name' => ''], + ['mappings' => [ + 'dynamic' => false, + 'fields' => [ + '' => [ + 'type' => 'string', + 'analyzer' => 'lucene.standard' + ] + ] + ]] ); // end-search-update // start-search-delete -$result = $collection->dropIndex(''); +$collection->dropSearchIndex(''); // end-search-delete // start-text -$result = $collection->createIndex(['' => 'text']); +$indexName = $collection->createIndex(['' => 'text']); // end-text // start-geo -$result = $collection->createIndex( - [ '' => '2dsphere'], ['name' => ''] +$indexName = $collection->createIndex( + [ '' => '2dsphere'] ); // end-geo // start-unique -$result = $collection->createIndex(['' => 1], ['unique' => true]); +$indexName = $collection->createIndex(['' => 1], ['unique' => true]); // end-unique // start-wildcard -$result = $collection->createIndex(['$**' => 1]); +$indexName = $collection->createIndex(['$**' => 1]); // end-wildcard // start-clustered @@ -76,10 +92,10 @@ // start-list foreach ($collection->listIndexes() as $indexInfo) { - var_dump($indexInfo); + echo toJSON($indexInfo) . PHP_EOL; } // end-list // start-remove -$result = $collection->dropIndex(''); +$collection->dropIndex(''); // end-remove \ No newline at end of file diff --git a/source/indexes.txt b/source/indexes.txt index b1c3155d..cd9fa904 100644 --- a/source/indexes.txt +++ b/source/indexes.txt @@ -53,6 +53,16 @@ target namespace. :linenos: :emphasize-lines: 10-12 +Some examples use the ``toJSON()`` function to represent change events, which are BSON +documents, as Extended JSON. To use this function, paste the following code into your +application file: + +.. literalinclude:: /includes/usage-examples/index-code-examples.php + :language: php + :dedent: + :start-after: start-to-json + :end-before: end-to-json + Single Field Index ------------------ @@ -112,6 +122,9 @@ that has GeoJSON object values: :copyable: :dedent: +To learn more about the GeoJSON data type, see :manual:`GeoJSON Objects +` in the {+mdb-server+} manual. + .. TODO: To learn more about geospatial indexes, see the :ref:`php-geospatial-index` .. guide. @@ -164,12 +177,62 @@ ascending clustered index on the ``_id`` field: .. TODO: To learn more about clustered indexes, see the :ref:`php-clustered-index` .. guide. +Text Index +---------- + +The following example creates a text index on the specified string field: + +.. literalinclude:: /includes/usage-examples/index-code-examples.php + :start-after: start-text + :end-before: end-text + :language: php + :copyable: + :dedent: + +.. TODO: To learn more about text indexes, see the :ref:`php-text-index` +.. guide. + +List Indexes +------------ + +The following example prints a list of indexes in the +specified collection: + +.. literalinclude:: /includes/usage-examples/index-code-examples.php + :start-after: start-list + :end-before: end-list + :language: php + :copyable: + :dedent: + +Delete an Index +--------------- + +The following example deletes an index with the specified name: + +.. literalinclude:: /includes/usage-examples/index-code-examples.php + :start-after: start-remove + :end-before: end-remove + :language: php + :copyable: + :dedent: + +.. TODO: To learn more about removing indexes, see :ref:`php-indexes-remove` +.. in the Work with Indexes guide. + Atlas Search Index Management ----------------------------- The following sections contain code examples that describe how to manage :atlas:`Atlas Search indexes `. +.. note:: Search Index Management is Asynchronous + + The {+php-library+} manages Atlas Search indexes asynchronously. The + library methods described in the following sections return the server + response immediately, but the changes to your Search indexes take + place in the background and might not complete until some time later. + .. To learn more about Atlas Search indexes, see the :ref:`php-atlas-search-index` .. guide. @@ -233,47 +296,4 @@ The following example deletes an Atlas Search index with the specified name: :dedent: .. To learn more about deleting search indexes, see the :ref:`php-atlas-search-index-drop` -.. guide. - -Text Index ----------- - -The following example creates a text index on the specified string field: - -.. literalinclude:: /includes/usage-examples/index-code-examples.php - :start-after: start-text - :end-before: end-text - :language: php - :copyable: - :dedent: - -.. TODO: To learn more about text indexes, see the :ref:`php-text-index` -.. guide. - -List Indexes ------------- - -The following example prints a list of indexes in the -specified collection: - -.. literalinclude:: /includes/usage-examples/index-code-examples.php - :start-after: start-list - :end-before: end-list - :language: php - :copyable: - :dedent: - -Delete an Index ---------------- - -The following example deletes an index with the specified name: - -.. literalinclude:: /includes/usage-examples/index-code-examples.php - :start-after: start-remove - :end-before: end-remove - :language: php - :copyable: - :dedent: - -.. TODO: To learn more about removing indexes, see :ref:`php-indexes-remove` -.. in the Work with Indexes guide. \ No newline at end of file +.. guide. \ No newline at end of file From a8de178842b5685e4094c382b2408c954d067723 Mon Sep 17 00:00:00 2001 From: rustagir Date: Tue, 10 Sep 2024 11:10:30 -0400 Subject: [PATCH 7/9] wip --- source/includes/usage-examples/index-code-examples.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/includes/usage-examples/index-code-examples.php b/source/includes/usage-examples/index-code-examples.php index 0bea50b0..29ec1ca3 100644 --- a/source/includes/usage-examples/index-code-examples.php +++ b/source/includes/usage-examples/index-code-examples.php @@ -32,7 +32,7 @@ function toJSON(object $document): string // start-search-create $indexName = $collection->createSearchIndex( ['mappings' => ['dynamic' => true]], - ['name' => ''] + ['name' => ''] ); // end-search-create @@ -44,7 +44,7 @@ function toJSON(object $document): string // start-search-update $collection->updateSearchIndex( - ['name' => ''], + '', ['mappings' => [ 'dynamic' => false, 'fields' => [ From 69668bd8379fb8258c52525ef97e51c129c5c55c Mon Sep 17 00:00:00 2001 From: rustagir Date: Tue, 10 Sep 2024 11:16:25 -0400 Subject: [PATCH 8/9] wip --- source/includes/usage-examples/index-code-examples.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/includes/usage-examples/index-code-examples.php b/source/includes/usage-examples/index-code-examples.php index 29ec1ca3..eadedb1e 100644 --- a/source/includes/usage-examples/index-code-examples.php +++ b/source/includes/usage-examples/index-code-examples.php @@ -92,7 +92,7 @@ function toJSON(object $document): string // start-list foreach ($collection->listIndexes() as $indexInfo) { - echo toJSON($indexInfo) . PHP_EOL; + echo $indexInfo; } // end-list From cbc3879eea4e26edee721a11206d2c3f7ce6d151 Mon Sep 17 00:00:00 2001 From: rustagir Date: Tue, 10 Sep 2024 12:39:40 -0400 Subject: [PATCH 9/9] JM tech review 2 --- source/includes/usage-examples/index-code-examples.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/includes/usage-examples/index-code-examples.php b/source/includes/usage-examples/index-code-examples.php index eadedb1e..4dee0dc4 100644 --- a/source/includes/usage-examples/index-code-examples.php +++ b/source/includes/usage-examples/index-code-examples.php @@ -38,7 +38,7 @@ function toJSON(object $document): string // start-search-list foreach ($collection->listSearchIndexes() as $indexInfo) { - echo toJSON($indexInfo) . PHP_EOL; + echo toJSON($indexInfo) , PHP_EOL; } // end-search-list