From 65592db0ff6ce38fb2128823fc05bd9d52323967 Mon Sep 17 00:00:00 2001 From: norareidy Date: Tue, 13 Aug 2024 16:14:12 -0400 Subject: [PATCH 1/7] DOCSP-41974: Specify a query --- snooty.toml | 1 + source/includes/read/specify-queries.php | 113 ++++++++++ source/index.txt | 1 + source/read.txt | 11 + source/read/specify-a-query.txt | 258 +++++++++++++++++++++++ 5 files changed, 384 insertions(+) create mode 100644 source/includes/read/specify-queries.php create mode 100644 source/read.txt create mode 100644 source/read/specify-a-query.txt diff --git a/snooty.toml b/snooty.toml index a08a8d41..3b8e70cb 100644 --- a/snooty.toml +++ b/snooty.toml @@ -24,3 +24,4 @@ php-library = "MongoDB PHP Library" [constants] php-library = "MongoDB PHP Library" +mdb-server = "MongoDB Server" diff --git a/source/includes/read/specify-queries.php b/source/includes/read/specify-queries.php new file mode 100644 index 00000000..79377f3c --- /dev/null +++ b/source/includes/read/specify-queries.php @@ -0,0 +1,113 @@ +"; +$client = new Client($uri); + +$db = $client->db; +$collection = $db->fruits; + +// Inserts documents representing fruits +$fruits = [ + [ + '_id' => 1, + 'name' => 'apples', + 'qty' => 5, + 'rating' => 3, + 'color' => 'red', + 'type' => ['fuji', 'honeycrisp'] + ], + [ + '_id' => 2, + 'name' => 'bananas', + 'qty' => 7, + 'rating' => 4, + 'color' => 'yellow', + 'type' => ['cavendish'] + ], + [ + '_id' => 3, + 'name' => 'oranges', + 'qty' => 6, + 'rating' => 2, + 'type' => ['naval', 'mandarin'] + ], + [ + '_id' => 4, + 'name' => 'pineapples', + 'qty' => 3, + 'rating' => 5, + 'color' => 'yellow' + ] +]; + +$result = $collection->insertMany($fruits); +// end-setup + +// Retrieves documents in which the "color" value is "yellow" +// start-find-exact +$cursor = $collection->find(['color' => 'yellow']); +foreach ($cursor as $doc) { + echo json_encode($doc) . PHP_EOL; +} +// end-find-exact + +// Retrieves all documents in the collection +// start-find-all +$cursor = $collection->find([]); +foreach ($cursor as $doc) { + echo json_encode($doc) . PHP_EOL; +} +// end-find-all + +// Retrieves and prints documents in which the "rating" value is greater than 2 +// start-find-comparison +$cursor = $collection->find(['rating' => ['$gt' => 2]]); +foreach ($cursor as $doc) { + echo json_encode($doc) . PHP_EOL; +} +// end-find-comparison + +// Retrieves and prints documents that match one or both query filters +// start-find-logical +$cursor = $collection->find([ + '$or' => [ + ['qty' => ['$gt' => 5]], + ['color' => 'yellow'] + ] +]); +foreach ($cursor as $doc) { + echo json_encode($doc) . PHP_EOL; +} +// end-find-logical + +// Retrieves and prints documents in which the "type" array has 2 elements +// start-find-array +$cursor = $collection->find(['type' => ['$size' => 2]]); +foreach ($cursor as $doc) { + echo json_encode($doc) . PHP_EOL; +} +// end-find-array + +// Retrieves and prints documents that have a "color" field +// start-find-element +$cursor = $collection->find(['color' => ['$exists' => true]]); +foreach ($cursor as $doc) { + echo json_encode($doc) . PHP_EOL; +} +// end-find-element + +// Retrieves and prints documents in which the "name" value has at least two consecutive "p" characters +// start-find-evaluation +$cursor = $collection->find(['name' => ['$regex' => 'p{2,}']]); +foreach ($cursor as $doc) { + echo json_encode($doc) . PHP_EOL; +} +// end-find-evaluation + +?> \ No newline at end of file diff --git a/source/index.txt b/source/index.txt index 244f3eb2..26734024 100644 --- a/source/index.txt +++ b/source/index.txt @@ -12,6 +12,7 @@ MongoDB PHP Library Installation Get Started + /read /tutorial /upgrade /reference diff --git a/source/read.txt b/source/read.txt new file mode 100644 index 00000000..f42b54fc --- /dev/null +++ b/source/read.txt @@ -0,0 +1,11 @@ +.. _php-read: + +====================== +Read Data from MongoDB +====================== + +.. toctree:: + :titlesonly: + :maxdepth: 1 + + /read/specify-a-query \ No newline at end of file diff --git a/source/read/specify-a-query.txt b/source/read/specify-a-query.txt new file mode 100644 index 00000000..a1dd04bb --- /dev/null +++ b/source/read/specify-a-query.txt @@ -0,0 +1,258 @@ +.. _php-specify-query: + +=============== +Specify a Query +=============== + +.. contents:: On this page + :local: + :backlinks: none + :depth: 2 + :class: singlecol + +.. facet:: + :name: genre + :values: reference + +.. meta:: + :keywords: expressions, operations, read, write, filter + +Overview +-------- + +In this guide, you can learn how to specify a query by using the {+php-library+}. + +You can refine the set of documents that a query returns by creating a +**query filter**. A query filter is an expression that specifies the search +criteria that MongoDB uses to match documents in a read or write operation. +In a query filter, you can prompt the driver to search for documents that have +an exact match to your query, or you can compose query filters to express more +complex matching criteria. + +Sample Data +~~~~~~~~~~~ + +The examples in this guide run operations on a collection called +``fruits``, which contains documents representing fruits. The following +code example shows how to create a database and collection, then +insert the sample documents into your collection: + +.. literalinclude:: /includes/read/specify-queries.php + :start-after: start-setup + :end-before: end-setup + :language: php + :dedent: + :copyable: + +Exact Match +----------- + +Literal value queries return documents that have an exact match to your query filter. + +The following example specifies a query filter as a parameter to the ``MongoDB\Collection::find()`` +method. The code returns all documents in which the value of the ``color`` field +is ``'yellow'``: + +.. io-code-block:: + :copyable: + + .. input:: /includes/read/specify-queries.php + :start-after: start-find-exact + :end-before: end-find-exact + :language: php + :dedent: + + .. output:: + + { "_id" : 2, "name" : "bananas", "qty" : 7, "rating" : 4, "color" : "yellow", "type" : [ "cavendish" ] } + { "_id" : 4, "name" : "pineapple", "qty" : 3, "rating" : 5, "color" : "yellow" } + +.. tip:: Find All Documents + + To find all documents in a collection, call the ``find()`` method and pass it an + empty query filter. The following example finds all documents in a + collection: + + .. literalinclude:: /includes/read/specify-queries.php + :start-after: start-find-all + :end-before: end-find-all + :language: php + :dedent: + :copyable: + +Comparison Operators +-------------------- + +Comparison operators evaluate a document field value against a specified value +in your query filter. The following list defines common comparison operators: + +- ``$gt``: Greater than +- ``$lte``: Less than or Equal +- ``$ne``: Not equal + +To view a full list of comparison operators, see the :manual:`Comparison Query Operators +` guide in the {+mdb-server+} manual. + +The following example specifies a comparison operator in a query filter as a +parameter to the ``MongoDB\Collection::find()`` method. The code returns all documents +that have a ``rating`` field value greater than ``2``: + +.. io-code-block:: + :copyable: + + .. input:: /includes/read/specify-queries.php + :start-after: start-find-comparison + :end-before: end-find-comparison + :language: php + :dedent: + + .. output:: + + { "_id" : 1, "name" : "apples", "qty" : 5, "rating" : 3, "color" : "red", "type" : [ "fuji", "honeycrisp" ] } + { "_id" : 2, "name" : "bananas", "qty" : 7, "rating" : 4, "color" : "yellow", "type" : [ "cavendish" ] } + { "_id" : 4, "name" : "pineapples", "qty" : 3, "rating" : 5, "color" : "yellow" } + +Logical Operators +----------------- + +Logical operators match documents by using logic applied to the results of two or +more sets of expressions. The following list describes each logical operator: + +- ``$and``: Returns all documents that match the conditions of *all* clauses +- ``$or``: Returns all documents that match the conditions of *one* clause +- ``$nor``: Returns all documents that *do not* match the conditions of any clause +- ``$not``: Returns all documents that *do not* match the expression + +To learn more about logical operators, see the :manual:`Logical Query Operators +` guide in the {+mdb-server+} manual. + +The following example specifies a logical operator in a query filter as a +parameter to the ``MongoDB\Collection::find()`` method. The code returns all documents +in which the ``qty`` field value is greater than ``5`` **or** the ``color`` field +value is ``'yellow'``: + +.. io-code-block:: + :copyable: + + .. input:: /includes/read/specify-queries.php + :start-after: start-find-logical + :end-before: end-find-logical + :language: php + :dedent: + + .. output:: + + { "_id" : 2, "name" : "bananas", "qty" : 7, "rating" : 4, "color" : "yellow", "type" : [ "cavendish" ] } + { "_id" : 3, "name" : "oranges", "qty" : 6, "rating" : 2, "type" : [ "naval", "mandarin" ] } + { "_id" : 4, "name" : "pineapples", "qty" : 3, "rating" : 5, "color" : "yellow" } + +Array Operators +--------------- + +Array operators match documents based on the value or quantity of elements in an +array field. The following list describes the available array operators: + +- ``$all``: Returns documents with arrays that contain all elements in the query +- ``$elemMatch``: Returns documents if an element in their array field matches all conditions in the query +- ``$size``: Returns all documents with arrays of a specified size + +To learn more about array operators, see the :manual:`Array Query Operators +` guide in the {+mdb-server+} manual. + +The following example specifies an array operator in a query filter as a +parameter to the ``MongoDB\Collection::find()`` method. The code returns all +documents in which the ``type`` array field contains ``2`` elements: + +.. io-code-block:: + :copyable: + + .. input:: /includes/read/specify-queries.php + :start-after: start-find-array + :end-before: end-find-array + :language: php + :dedent: + + .. output:: + + { "_id" : 1, "name" : "apples", "qty" : 5, "rating" : 3, "color" : "red", "type" : [ "fuji", "honeycrisp" ] } + { "_id" : 3, "name" : "oranges", "qty" : 6, "rating" : 2, "type" : [ "naval", "mandarin" ] } + +Element Operators +----------------- + +Element operators query data based on the presence or type of a field. + +To learn more about element operators, see the :manual:`Element Query Operators +` guide in the {+mdb-server+} manual. + +The following example specifies an element operator in a query filter as a +parameter to the ``MongoDB\Collection::find()`` method. The code returns all +documents that have a ``color`` field: + +.. io-code-block:: + :copyable: + + .. input:: /includes/read/specify-queries.php + :start-after: start-find-element + :end-before: end-find-element + :language: php + :dedent: + + .. output:: + + { "_id" : 1, "name" : "apples", "qty" : 5, "rating" : 3, "color" : "red", "type" : [ "fuji", "honeycrisp" ] } + { "_id" : 2, "name" : "bananas", "qty" : 7, "rating" : 4, "color" : "yellow", "type" : [ "cavendish" ] } + { "_id" : 4, "name" : "pineapples", "qty" : 3, "rating" : 5, "color" : "yellow" } + +Evaluation Operators +-------------------- + +Evaluation operators return data based on evaluations of either individual +fields or the entire collection's documents. + +The following list describes common evaluation operators: + +- ``$text``: Performs a text search on the documents +- ``$regex``: Returns documents that match a specified regular expression +- ``$mod``: Performs a modulo operation on the value of a field and + returns documents where the remainder is a specified value + +To view a full list of evaluation operators, see the :manual:`Evaluation Query Operators +` guide in the {+mdb-server+} manual. + +The following example specifies an evaluation operator in a query filter as a +parameter to the ``MongoDB\Collection::find()`` method. The code uses a regular +expression to return all documents in which the ``name`` field value has at least +two consecutive ``'p'`` characters: + +.. io-code-block:: + :copyable: + + .. input:: /includes/read/specify-queries.php + :start-after: start-find-evaluation + :end-before: end-find-evaluation + :language: php + :dedent: + + .. output:: + + { "_id" : 1, "name" : "apples", "qty" : 5, "rating" : 3, "color" : "red", "type" : [ "fuji", "honeycrisp" ] } + { "_id" : 4, "name" : "pineapples", "qty" : 3, "rating" : 5, "color" : "yellow" } + +Additional Information +---------------------- + +To learn more about querying documents, see the :manual:`Query Documents +` guide in the {+mdb-server+} manual. + +.. TODO: + To learn more about retrieving documents with the {+php-library+}, see the + :ref:`php-retrieve` guide. + +API Documentation +~~~~~~~~~~~~~~~~~ + +To learn more about any of the methods or types discussed in this +guide, see the following API documentation: + +- `MongoDB\Collection::find() <{+api+}/method/MongoDBCollection-find/>`__ \ No newline at end of file From a262c74153ebef740528d3941acd35bb7240f519 Mon Sep 17 00:00:00 2001 From: norareidy Date: Tue, 13 Aug 2024 16:23:19 -0400 Subject: [PATCH 2/7] edits --- source/read/specify-a-query.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/source/read/specify-a-query.txt b/source/read/specify-a-query.txt index a1dd04bb..c7821480 100644 --- a/source/read/specify-a-query.txt +++ b/source/read/specify-a-query.txt @@ -63,7 +63,8 @@ is ``'yellow'``: :dedent: .. output:: - + :visible: false + { "_id" : 2, "name" : "bananas", "qty" : 7, "rating" : 4, "color" : "yellow", "type" : [ "cavendish" ] } { "_id" : 4, "name" : "pineapple", "qty" : 3, "rating" : 5, "color" : "yellow" } @@ -107,6 +108,7 @@ that have a ``rating`` field value greater than ``2``: :dedent: .. output:: + :visible: false { "_id" : 1, "name" : "apples", "qty" : 5, "rating" : 3, "color" : "red", "type" : [ "fuji", "honeycrisp" ] } { "_id" : 2, "name" : "bananas", "qty" : 7, "rating" : 4, "color" : "yellow", "type" : [ "cavendish" ] } @@ -141,6 +143,7 @@ value is ``'yellow'``: :dedent: .. output:: + :visible: false { "_id" : 2, "name" : "bananas", "qty" : 7, "rating" : 4, "color" : "yellow", "type" : [ "cavendish" ] } { "_id" : 3, "name" : "oranges", "qty" : 6, "rating" : 2, "type" : [ "naval", "mandarin" ] } @@ -173,6 +176,7 @@ documents in which the ``type`` array field contains ``2`` elements: :dedent: .. output:: + :visible: false { "_id" : 1, "name" : "apples", "qty" : 5, "rating" : 3, "color" : "red", "type" : [ "fuji", "honeycrisp" ] } { "_id" : 3, "name" : "oranges", "qty" : 6, "rating" : 2, "type" : [ "naval", "mandarin" ] } @@ -199,6 +203,7 @@ documents that have a ``color`` field: :dedent: .. output:: + :visible: false { "_id" : 1, "name" : "apples", "qty" : 5, "rating" : 3, "color" : "red", "type" : [ "fuji", "honeycrisp" ] } { "_id" : 2, "name" : "bananas", "qty" : 7, "rating" : 4, "color" : "yellow", "type" : [ "cavendish" ] } @@ -235,6 +240,7 @@ two consecutive ``'p'`` characters: :dedent: .. output:: + :visible: false { "_id" : 1, "name" : "apples", "qty" : 5, "rating" : 3, "color" : "red", "type" : [ "fuji", "honeycrisp" ] } { "_id" : 4, "name" : "pineapples", "qty" : 3, "rating" : 5, "color" : "yellow" } @@ -255,4 +261,4 @@ API Documentation To learn more about any of the methods or types discussed in this guide, see the following API documentation: -- `MongoDB\Collection::find() <{+api+}/method/MongoDBCollection-find/>`__ \ No newline at end of file +- `MongoDB\\Collection::find() <{+api+}/method/MongoDBCollection-find/>`__ \ No newline at end of file From 1445f0cd7ead6b0a537570690c83ec38721bf5b2 Mon Sep 17 00:00:00 2001 From: norareidy Date: Tue, 13 Aug 2024 16:29:45 -0400 Subject: [PATCH 3/7] output --- source/read/specify-a-query.txt | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/source/read/specify-a-query.txt b/source/read/specify-a-query.txt index c7821480..edb6e3c1 100644 --- a/source/read/specify-a-query.txt +++ b/source/read/specify-a-query.txt @@ -65,8 +65,8 @@ is ``'yellow'``: .. output:: :visible: false - { "_id" : 2, "name" : "bananas", "qty" : 7, "rating" : 4, "color" : "yellow", "type" : [ "cavendish" ] } - { "_id" : 4, "name" : "pineapple", "qty" : 3, "rating" : 5, "color" : "yellow" } + {"_id":2,"name":"bananas","qty":7,"rating":4,"color":"yellow","type":["cavendish"]} + {"_id":4,"name":"pineapples","qty":3,"rating":5,"color":"yellow"} .. tip:: Find All Documents @@ -110,9 +110,9 @@ that have a ``rating`` field value greater than ``2``: .. output:: :visible: false - { "_id" : 1, "name" : "apples", "qty" : 5, "rating" : 3, "color" : "red", "type" : [ "fuji", "honeycrisp" ] } - { "_id" : 2, "name" : "bananas", "qty" : 7, "rating" : 4, "color" : "yellow", "type" : [ "cavendish" ] } - { "_id" : 4, "name" : "pineapples", "qty" : 3, "rating" : 5, "color" : "yellow" } + {"_id":1,"name":"apples","qty":5,"rating":3,"color":"red","type":["fuji","honeycrisp"]} + {"_id":2,"name":"bananas","qty":7,"rating":4,"color":"yellow","type":["cavendish"]} + {"_id":4,"name":"pineapples","qty":3,"rating":5,"color":"yellow"} Logical Operators ----------------- @@ -145,9 +145,9 @@ value is ``'yellow'``: .. output:: :visible: false - { "_id" : 2, "name" : "bananas", "qty" : 7, "rating" : 4, "color" : "yellow", "type" : [ "cavendish" ] } - { "_id" : 3, "name" : "oranges", "qty" : 6, "rating" : 2, "type" : [ "naval", "mandarin" ] } - { "_id" : 4, "name" : "pineapples", "qty" : 3, "rating" : 5, "color" : "yellow" } + {"_id":2,"name":"bananas","qty":7,"rating":4,"color":"yellow","type":["cavendish"]} + {"_id":3,"name":"oranges","qty":6,"rating":2,"type":["naval","mandarin"]} + {"_id":4,"name":"pineapples","qty":3,"rating":5,"color":"yellow"} Array Operators --------------- @@ -178,8 +178,8 @@ documents in which the ``type`` array field contains ``2`` elements: .. output:: :visible: false - { "_id" : 1, "name" : "apples", "qty" : 5, "rating" : 3, "color" : "red", "type" : [ "fuji", "honeycrisp" ] } - { "_id" : 3, "name" : "oranges", "qty" : 6, "rating" : 2, "type" : [ "naval", "mandarin" ] } + {"_id":1,"name":"apples","qty":5,"rating":3,"color":"red","type":["fuji","honeycrisp"]} + {"_id":3,"name":"oranges","qty":6,"rating":2,"type":["naval","mandarin"]} Element Operators ----------------- @@ -205,9 +205,9 @@ documents that have a ``color`` field: .. output:: :visible: false - { "_id" : 1, "name" : "apples", "qty" : 5, "rating" : 3, "color" : "red", "type" : [ "fuji", "honeycrisp" ] } - { "_id" : 2, "name" : "bananas", "qty" : 7, "rating" : 4, "color" : "yellow", "type" : [ "cavendish" ] } - { "_id" : 4, "name" : "pineapples", "qty" : 3, "rating" : 5, "color" : "yellow" } + {"_id":1,"name":"apples","qty":5,"rating":3,"color":"red","type":["fuji","honeycrisp"]} + {"_id":2,"name":"bananas","qty":7,"rating":4,"color":"yellow","type":["cavendish"]} + {"_id":4,"name":"pineapples","qty":3,"rating":5,"color":"yellow"} Evaluation Operators -------------------- @@ -242,8 +242,8 @@ two consecutive ``'p'`` characters: .. output:: :visible: false - { "_id" : 1, "name" : "apples", "qty" : 5, "rating" : 3, "color" : "red", "type" : [ "fuji", "honeycrisp" ] } - { "_id" : 4, "name" : "pineapples", "qty" : 3, "rating" : 5, "color" : "yellow" } + {"_id":1,"name":"apples","qty":5,"rating":3,"color":"red","type":["fuji","honeycrisp"]} + {"_id":4,"name":"pineapples","qty":3,"rating":5,"color":"yellow"} Additional Information ---------------------- From ac920d4802519a97328e8bda29e43cd0abcf22c0 Mon Sep 17 00:00:00 2001 From: norareidy Date: Tue, 13 Aug 2024 16:31:25 -0400 Subject: [PATCH 4/7] fix --- source/includes/read/specify-queries.php | 1 - 1 file changed, 1 deletion(-) diff --git a/source/includes/read/specify-queries.php b/source/includes/read/specify-queries.php index 79377f3c..32674d94 100644 --- a/source/includes/read/specify-queries.php +++ b/source/includes/read/specify-queries.php @@ -4,7 +4,6 @@ use MongoDB\Client; - // start-setup $uri = ""; $client = new Client($uri); From a0b2ca25f92e7f0ac9a45949a99a8c191e61cc3c Mon Sep 17 00:00:00 2001 From: norareidy Date: Tue, 13 Aug 2024 16:34:25 -0400 Subject: [PATCH 5/7] snooty.toml --- snooty.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/snooty.toml b/snooty.toml index 3b8e70cb..d467bbde 100644 --- a/snooty.toml +++ b/snooty.toml @@ -25,3 +25,4 @@ php-library = "MongoDB PHP Library" [constants] php-library = "MongoDB PHP Library" mdb-server = "MongoDB Server" +api = "https://www.mongodb.com/docs/php-library/current/reference" From 738b828890dc1992afc0bef5a8a5f9a7ae83145d Mon Sep 17 00:00:00 2001 From: norareidy Date: Wed, 14 Aug 2024 11:01:02 -0400 Subject: [PATCH 6/7] RR feedback --- source/read/specify-a-query.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source/read/specify-a-query.txt b/source/read/specify-a-query.txt index edb6e3c1..9e38c2f6 100644 --- a/source/read/specify-a-query.txt +++ b/source/read/specify-a-query.txt @@ -32,8 +32,8 @@ complex matching criteria. Sample Data ~~~~~~~~~~~ -The examples in this guide run operations on a collection called -``fruits``, which contains documents representing fruits. The following +The examples in this guide run operations on the ``fruits`` collection, +which contains documents representing fruits. The following code example shows how to create a database and collection, then insert the sample documents into your collection: @@ -96,7 +96,7 @@ To view a full list of comparison operators, see the :manual:`Comparison Query O The following example specifies a comparison operator in a query filter as a parameter to the ``MongoDB\Collection::find()`` method. The code returns all documents -that have a ``rating`` field value greater than ``2``: +in which the value of the ``rating`` field is greater than ``2``: .. io-code-block:: :copyable: @@ -261,4 +261,5 @@ API Documentation To learn more about any of the methods or types discussed in this guide, see the following API documentation: -- `MongoDB\\Collection::find() <{+api+}/method/MongoDBCollection-find/>`__ \ No newline at end of file +- `MongoDB\\Collection::find() <{+api+}/method/MongoDBCollection-find/>`__ +- `MongoDB\\Collection::insertMany() <{+api+}/method/MongoDBCollection-insertMany/>`__ \ No newline at end of file From d80ba11c142179e67e4c47fb3feadd001fcbe2ca Mon Sep 17 00:00:00 2001 From: norareidy Date: Mon, 19 Aug 2024 17:18:00 -0400 Subject: [PATCH 7/7] code edits --- source/includes/read/specify-queries.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/source/includes/read/specify-queries.php b/source/includes/read/specify-queries.php index 32674d94..3e3c07cb 100644 --- a/source/includes/read/specify-queries.php +++ b/source/includes/read/specify-queries.php @@ -7,9 +7,7 @@ // start-setup $uri = ""; $client = new Client($uri); - -$db = $client->db; -$collection = $db->fruits; +$collection = $client->db->fruits; // Inserts documents representing fruits $fruits = [ @@ -108,5 +106,3 @@ echo json_encode($doc) . PHP_EOL; } // end-find-evaluation - -?> \ No newline at end of file