From e1dfe3b3f460a5f470f9c298cefce497a36e736c Mon Sep 17 00:00:00 2001 From: rustagir Date: Mon, 10 Mar 2025 14:55:34 -0400 Subject: [PATCH 01/13] DOCSP-43518: query logging --- docs/fundamentals/read-operations.txt | 3 +- .../read-operations/query-logging.txt | 115 ++++++++++++++++++ .../read-operations/ReadOperationsTest.php | 22 ++++ 3 files changed, 139 insertions(+), 1 deletion(-) create mode 100644 docs/fundamentals/read-operations/query-logging.txt diff --git a/docs/fundamentals/read-operations.txt b/docs/fundamentals/read-operations.txt index 367e2d38d..674615ffb 100644 --- a/docs/fundamentals/read-operations.txt +++ b/docs/fundamentals/read-operations.txt @@ -17,7 +17,8 @@ Read Operations Retrieve Data Search Text Modify Query Results - Set Read Preference + Read Preference + Query Logging .. contents:: On this page :local: diff --git a/docs/fundamentals/read-operations/query-logging.txt b/docs/fundamentals/read-operations/query-logging.txt new file mode 100644 index 000000000..4a44d1251 --- /dev/null +++ b/docs/fundamentals/read-operations/query-logging.txt @@ -0,0 +1,115 @@ +.. _laravel-query-logging: + +==================== +Enable Query Logging +==================== + +.. facet:: + :name: genre + :values: reference + +.. meta:: + :keywords: monitoring, CRUD, code example + +.. contents:: On this page + :local: + :backlinks: none + :depth: 2 + :class: singlecol + +Overview +-------- + +In this guide, you can learn how to enable query logging in +{+odm-long+}. Query logging can help you debug your queries and monitor +database interactions. + +.. include:: /includes/fundamentals/read-operations/before-you-get-started.rst + +Enable Logs On a Connection +--------------------------- + +To enable logs on a connection, you can use the ``enableQueryLog()`` +method on the ``DB`` facade. This method enables MongoDB command logging +on any queries that you perform on the database connection. + +After you enable query logging, any queries you perform are stored in +memory. To retrieve the logs, use one of the following methods: + +- ``getQueryLog()``: Returns a log of MongoDB queries +- ``getRawQueryLog()``: Returns a log of raw MongoDB queries + +The following example enables query logging, performs some queries, then +prints the query log: + +.. tabs:: + + .. tab:: Query Syntax + :tabid: query-syntax + + Use the following syntax to specify the query: + + .. literalinclude:: /includes/fundamentals/read-operations/ReadOperationsTest.php + :language: php + :dedent: + :start-after: start-query-log + :end-before: end-query-log + :emphasize-lines: 1, 7 + + .. tab:: Controller Method + :tabid: controller + + To see the logs in the ``browse_movies`` view, edit the ``show()`` function + in the ``MovieController.php`` file to resemble the following code: + + .. io-code-block:: + :copyable: true + + .. input:: + :language: php + + class MovieController + { + public function show() + { + DB::connection('mongodb')->enableQueryLog(); + + Movie::where('title', 'Carrie')->get(); + Movie::where('year', '<', 2005)->get(); + Movie::where('imdb.rating', '>', 8.5)->get(); + + $logs = DB::connection('mongodb')->getQueryLog(); + foreach ($logs as $log) { + echo json_encode($log, JSON_PRETTY_PRINT); + } + } + } + + .. output:: + :language: none + :visible: false + + { + "query": "{ \"find\" : \"movies\", \"filter\" : { \"title\" : \"Carrie\" } }", + "bindings": [], + "time": 29476 + } + { + "query": "{ \"find\" : \"movies\", \"filter\" : { \"year\" : { \"$lt\" : { \"$numberInt\" : \"2005\" } } } }", + "bindings": [], + "time": 29861 + } + { + "query": "{ \"find\" : \"movies\", \"filter\" : { \"imdb.rating\" : { \"$gt\" : { \"$numberDouble\" : \"8.5\" } } } }", + "bindings": [], + "time": 27251 + } + +Additional Information +---------------------- + +To learn more about connecting to MongoDB, see the +:ref:`laravel-connect-to-mongodb`. + +To learn how to retrieve data based on filter criteria, see the +:ref:`laravel-fundamentals-read-retrieve` guide. diff --git a/docs/includes/fundamentals/read-operations/ReadOperationsTest.php b/docs/includes/fundamentals/read-operations/ReadOperationsTest.php index 207fd442e..c87223ca8 100644 --- a/docs/includes/fundamentals/read-operations/ReadOperationsTest.php +++ b/docs/includes/fundamentals/read-operations/ReadOperationsTest.php @@ -183,4 +183,26 @@ public function testReadPreference(): void $this->assertNotNull($movies); $this->assertCount(2, $movies); } + + /** + * @runInSeparateProcess + * @preserveGlobalState disabled + */ + public function testQueryLog(): void + { + // start-query-log + DB::connection('mongodb')->enableQueryLog(); + + Movie::where('title', 'Carrie')->get(); + Movie::where('year', '<', 2005)->get(); + Movie::where('imdb.rating', '>', 8.5)->get(); + + $logs = DB::connection('mongodb')->getQueryLog(); + foreach ($logs as $log) { + echo json_encode($log, JSON_PRETTY_PRINT); + } + // end-query-log + + $this->assertNotNull($logs); + } } From 22f480c76d4c6332fbdf1f3a2e3dade45807fa2f Mon Sep 17 00:00:00 2001 From: rustagir Date: Mon, 10 Mar 2025 14:57:58 -0400 Subject: [PATCH 02/13] formatting --- .../fundamentals/read-operations/ReadOperationsTest.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/includes/fundamentals/read-operations/ReadOperationsTest.php b/docs/includes/fundamentals/read-operations/ReadOperationsTest.php index c87223ca8..7ab61327a 100644 --- a/docs/includes/fundamentals/read-operations/ReadOperationsTest.php +++ b/docs/includes/fundamentals/read-operations/ReadOperationsTest.php @@ -9,6 +9,10 @@ use MongoDB\Driver\ReadPreference; use MongoDB\Laravel\Tests\TestCase; +use function json_encode; + +use const JSON_PRETTY_PRINT; + class ReadOperationsTest extends TestCase { protected function setUp(): void @@ -201,6 +205,7 @@ public function testQueryLog(): void foreach ($logs as $log) { echo json_encode($log, JSON_PRETTY_PRINT); } + // end-query-log $this->assertNotNull($logs); From 4bbfbda47ac970e7e1087e97c53a4cf0496293cf Mon Sep 17 00:00:00 2001 From: rustagir Date: Mon, 10 Mar 2025 15:03:11 -0400 Subject: [PATCH 03/13] remove controller --- .../read-operations/query-logging.txt | 89 ++++++------------- 1 file changed, 28 insertions(+), 61 deletions(-) diff --git a/docs/fundamentals/read-operations/query-logging.txt b/docs/fundamentals/read-operations/query-logging.txt index 4a44d1251..19c61b0ea 100644 --- a/docs/fundamentals/read-operations/query-logging.txt +++ b/docs/fundamentals/read-operations/query-logging.txt @@ -42,68 +42,35 @@ memory. To retrieve the logs, use one of the following methods: The following example enables query logging, performs some queries, then prints the query log: -.. tabs:: - - .. tab:: Query Syntax - :tabid: query-syntax - - Use the following syntax to specify the query: - - .. literalinclude:: /includes/fundamentals/read-operations/ReadOperationsTest.php - :language: php - :dedent: - :start-after: start-query-log - :end-before: end-query-log - :emphasize-lines: 1, 7 - - .. tab:: Controller Method - :tabid: controller - - To see the logs in the ``browse_movies`` view, edit the ``show()`` function - in the ``MovieController.php`` file to resemble the following code: - - .. io-code-block:: - :copyable: true - - .. input:: - :language: php - - class MovieController - { - public function show() - { - DB::connection('mongodb')->enableQueryLog(); - - Movie::where('title', 'Carrie')->get(); - Movie::where('year', '<', 2005)->get(); - Movie::where('imdb.rating', '>', 8.5)->get(); - - $logs = DB::connection('mongodb')->getQueryLog(); - foreach ($logs as $log) { - echo json_encode($log, JSON_PRETTY_PRINT); - } - } - } - - .. output:: - :language: none - :visible: false +.. io-code-block:: + :copyable: true + + .. input:: /includes/fundamentals/read-operations/ReadOperationsTest.php + :language: php + :dedent: + :start-after: start-query-log + :end-before: end-query-log + :emphasize-lines: 1, 7 + + .. output:: + :language: json + :visible: false - { - "query": "{ \"find\" : \"movies\", \"filter\" : { \"title\" : \"Carrie\" } }", - "bindings": [], - "time": 29476 - } - { - "query": "{ \"find\" : \"movies\", \"filter\" : { \"year\" : { \"$lt\" : { \"$numberInt\" : \"2005\" } } } }", - "bindings": [], - "time": 29861 - } - { - "query": "{ \"find\" : \"movies\", \"filter\" : { \"imdb.rating\" : { \"$gt\" : { \"$numberDouble\" : \"8.5\" } } } }", - "bindings": [], - "time": 27251 - } + { + "query": "{ \"find\" : \"movies\", \"filter\" : { \"title\" : \"Carrie\" } }", + "bindings": [], + "time": 29476 + } + { + "query": "{ \"find\" : \"movies\", \"filter\" : { \"year\" : { \"$lt\" : { \"$numberInt\" : \"2005\" } } } }", + "bindings": [], + "time": 29861 + } + { + "query": "{ \"find\" : \"movies\", \"filter\" : { \"imdb.rating\" : { \"$gt\" : { \"$numberDouble\" : \"8.5\" } } } }", + "bindings": [], + "time": 27251 + } Additional Information ---------------------- From 7ee7d404f235b42d73d8c3a31171b16937f17c3e Mon Sep 17 00:00:00 2001 From: rustagir Date: Mon, 10 Mar 2025 15:10:25 -0400 Subject: [PATCH 04/13] tests --- .../fundamentals/read-operations/ReadOperationsTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/includes/fundamentals/read-operations/ReadOperationsTest.php b/docs/includes/fundamentals/read-operations/ReadOperationsTest.php index 7ab61327a..7a5c35269 100644 --- a/docs/includes/fundamentals/read-operations/ReadOperationsTest.php +++ b/docs/includes/fundamentals/read-operations/ReadOperationsTest.php @@ -208,6 +208,8 @@ public function testQueryLog(): void // end-query-log + $this->expectOutputRegex('/^{"title":"Marriage Story","year":2019,"runtime":136,"updated_at":".{27}","created_at":".{27}","id":"[a-z0-9]{24}"}$/'); + $this->expectOutputString('{ "query": "{ \"find\" : \"movies\", \"filter\" : { \"title\" : \"Carrie\" } }", "bindings": [], "time": 35366 }{ "query": "{ \"find\" : \"movies\", \"filter\" : { \"year\" : { \"$lt\" : { \"$numberInt\" : \"2005\" } } } }", "bindings": [], "time": 31571 }{ "query": "{ \"find\" : \"movies\", \"filter\" : { \"imdb.rating\" : { \"$gt\" : { \"$numberDouble\" : \"8.5\" } } } }", "bindings": [], "time": 26469 }'); $this->assertNotNull($logs); } } From e4f886dea0172a0339f545f6f42f17fce179ba6f Mon Sep 17 00:00:00 2001 From: rustagir Date: Mon, 10 Mar 2025 15:12:48 -0400 Subject: [PATCH 05/13] tests --- .../includes/fundamentals/read-operations/ReadOperationsTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/includes/fundamentals/read-operations/ReadOperationsTest.php b/docs/includes/fundamentals/read-operations/ReadOperationsTest.php index 7a5c35269..2006d38bc 100644 --- a/docs/includes/fundamentals/read-operations/ReadOperationsTest.php +++ b/docs/includes/fundamentals/read-operations/ReadOperationsTest.php @@ -208,7 +208,6 @@ public function testQueryLog(): void // end-query-log - $this->expectOutputRegex('/^{"title":"Marriage Story","year":2019,"runtime":136,"updated_at":".{27}","created_at":".{27}","id":"[a-z0-9]{24}"}$/'); $this->expectOutputString('{ "query": "{ \"find\" : \"movies\", \"filter\" : { \"title\" : \"Carrie\" } }", "bindings": [], "time": 35366 }{ "query": "{ \"find\" : \"movies\", \"filter\" : { \"year\" : { \"$lt\" : { \"$numberInt\" : \"2005\" } } } }", "bindings": [], "time": 31571 }{ "query": "{ \"find\" : \"movies\", \"filter\" : { \"imdb.rating\" : { \"$gt\" : { \"$numberDouble\" : \"8.5\" } } } }", "bindings": [], "time": 26469 }'); $this->assertNotNull($logs); } From 72cfdf89529761d7bbdf00af66d9f02c2a6b1399 Mon Sep 17 00:00:00 2001 From: rustagir Date: Mon, 10 Mar 2025 15:21:25 -0400 Subject: [PATCH 06/13] tests --- .../fundamentals/read-operations/ReadOperationsTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/includes/fundamentals/read-operations/ReadOperationsTest.php b/docs/includes/fundamentals/read-operations/ReadOperationsTest.php index 2006d38bc..448aa3262 100644 --- a/docs/includes/fundamentals/read-operations/ReadOperationsTest.php +++ b/docs/includes/fundamentals/read-operations/ReadOperationsTest.php @@ -208,7 +208,7 @@ public function testQueryLog(): void // end-query-log - $this->expectOutputString('{ "query": "{ \"find\" : \"movies\", \"filter\" : { \"title\" : \"Carrie\" } }", "bindings": [], "time": 35366 }{ "query": "{ \"find\" : \"movies\", \"filter\" : { \"year\" : { \"$lt\" : { \"$numberInt\" : \"2005\" } } } }", "bindings": [], "time": 31571 }{ "query": "{ \"find\" : \"movies\", \"filter\" : { \"imdb.rating\" : { \"$gt\" : { \"$numberDouble\" : \"8.5\" } } } }", "bindings": [], "time": 26469 }'); + $this->expectOutputRegex('\{ "query": "\{ \\"find\\" : \\"movies\\", \\"filter\\" : \{ \\"title\\" : \\"Carrie\\" \} \}", "bindings": \[\], "time": [0-9]+ \}\{ "query": "\{ \\"find\\" : \\"movies\\", \\"filter\\" : \{ \\"year\\" : \{ \\"\$lt\\" : \{ \\"\$numberInt\\" : \\"2005\\" \} \} \} \}", "bindings": \[\], "time": [0-9]+ \}\{ "query": "\{ \\"find\\" : \\"movies\\", \\"filter\\" : \{ \\"imdb\.rating\\" : \{ \\"\$gt\\" : \{ \\"\$numberDouble\\" : \\"8\.5\\" \} \} \} \}", "bindings": \[\], "time": [0-9]+ \}'); $this->assertNotNull($logs); } } From f23cc4fa6f2e753f74a8562f44158c9575712878 Mon Sep 17 00:00:00 2001 From: rustagir Date: Mon, 10 Mar 2025 15:26:22 -0400 Subject: [PATCH 07/13] tests --- .../includes/fundamentals/read-operations/ReadOperationsTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/includes/fundamentals/read-operations/ReadOperationsTest.php b/docs/includes/fundamentals/read-operations/ReadOperationsTest.php index 448aa3262..6a6e27715 100644 --- a/docs/includes/fundamentals/read-operations/ReadOperationsTest.php +++ b/docs/includes/fundamentals/read-operations/ReadOperationsTest.php @@ -209,6 +209,5 @@ public function testQueryLog(): void // end-query-log $this->expectOutputRegex('\{ "query": "\{ \\"find\\" : \\"movies\\", \\"filter\\" : \{ \\"title\\" : \\"Carrie\\" \} \}", "bindings": \[\], "time": [0-9]+ \}\{ "query": "\{ \\"find\\" : \\"movies\\", \\"filter\\" : \{ \\"year\\" : \{ \\"\$lt\\" : \{ \\"\$numberInt\\" : \\"2005\\" \} \} \} \}", "bindings": \[\], "time": [0-9]+ \}\{ "query": "\{ \\"find\\" : \\"movies\\", \\"filter\\" : \{ \\"imdb\.rating\\" : \{ \\"\$gt\\" : \{ \\"\$numberDouble\\" : \\"8\.5\\" \} \} \} \}", "bindings": \[\], "time": [0-9]+ \}'); - $this->assertNotNull($logs); } } From 59e3f03a1f2c96782729a63633fd1efc02615282 Mon Sep 17 00:00:00 2001 From: rustagir Date: Fri, 21 Mar 2025 13:53:06 -0400 Subject: [PATCH 08/13] test --- .../fundamentals/read-operations/ReadOperationsTest.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/includes/fundamentals/read-operations/ReadOperationsTest.php b/docs/includes/fundamentals/read-operations/ReadOperationsTest.php index 6a6e27715..9ac74d8b5 100644 --- a/docs/includes/fundamentals/read-operations/ReadOperationsTest.php +++ b/docs/includes/fundamentals/read-operations/ReadOperationsTest.php @@ -11,8 +11,6 @@ use function json_encode; -use const JSON_PRETTY_PRINT; - class ReadOperationsTest extends TestCase { protected function setUp(): void @@ -203,11 +201,11 @@ public function testQueryLog(): void $logs = DB::connection('mongodb')->getQueryLog(); foreach ($logs as $log) { - echo json_encode($log, JSON_PRETTY_PRINT); + echo json_encode($log); } // end-query-log - $this->expectOutputRegex('\{ "query": "\{ \\"find\\" : \\"movies\\", \\"filter\\" : \{ \\"title\\" : \\"Carrie\\" \} \}", "bindings": \[\], "time": [0-9]+ \}\{ "query": "\{ \\"find\\" : \\"movies\\", \\"filter\\" : \{ \\"year\\" : \{ \\"\$lt\\" : \{ \\"\$numberInt\\" : \\"2005\\" \} \} \} \}", "bindings": \[\], "time": [0-9]+ \}\{ "query": "\{ \\"find\\" : \\"movies\\", \\"filter\\" : \{ \\"imdb\.rating\\" : \{ \\"\$gt\\" : \{ \\"\$numberDouble\\" : \\"8\.5\\" \} \} \} \}", "bindings": \[\], "time": [0-9]+ \}'); + $this->expectOutputRegex(''); } } From 0add3abd40c4850674f6b45feb1b0b08c7d96418 Mon Sep 17 00:00:00 2001 From: rustagir Date: Fri, 21 Mar 2025 13:57:03 -0400 Subject: [PATCH 09/13] test --- docs/fundamentals/read-operations/query-logging.txt | 2 +- .../fundamentals/read-operations/ReadOperationsTest.php | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/docs/fundamentals/read-operations/query-logging.txt b/docs/fundamentals/read-operations/query-logging.txt index 19c61b0ea..27816b298 100644 --- a/docs/fundamentals/read-operations/query-logging.txt +++ b/docs/fundamentals/read-operations/query-logging.txt @@ -55,7 +55,7 @@ prints the query log: .. output:: :language: json :visible: false - + { "query": "{ \"find\" : \"movies\", \"filter\" : { \"title\" : \"Carrie\" } }", "bindings": [], diff --git a/docs/includes/fundamentals/read-operations/ReadOperationsTest.php b/docs/includes/fundamentals/read-operations/ReadOperationsTest.php index 9ac74d8b5..41aecf40e 100644 --- a/docs/includes/fundamentals/read-operations/ReadOperationsTest.php +++ b/docs/includes/fundamentals/read-operations/ReadOperationsTest.php @@ -9,8 +9,6 @@ use MongoDB\Driver\ReadPreference; use MongoDB\Laravel\Tests\TestCase; -use function json_encode; - class ReadOperationsTest extends TestCase { protected function setUp(): void @@ -200,12 +198,8 @@ public function testQueryLog(): void Movie::where('imdb.rating', '>', 8.5)->get(); $logs = DB::connection('mongodb')->getQueryLog(); - foreach ($logs as $log) { - echo json_encode($log); - } - // end-query-log - $this->expectOutputRegex(''); + $this->assertNotNull($logs); } } From 21d5fb3fed392699920e55a7b06e86b19b27cbc6 Mon Sep 17 00:00:00 2001 From: rustagir Date: Fri, 21 Mar 2025 14:00:21 -0400 Subject: [PATCH 10/13] test --- .../read-operations/ReadOperationsTest.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/includes/fundamentals/read-operations/ReadOperationsTest.php b/docs/includes/fundamentals/read-operations/ReadOperationsTest.php index 41aecf40e..1cbf51039 100644 --- a/docs/includes/fundamentals/read-operations/ReadOperationsTest.php +++ b/docs/includes/fundamentals/read-operations/ReadOperationsTest.php @@ -9,6 +9,11 @@ use MongoDB\Driver\ReadPreference; use MongoDB\Laravel\Tests\TestCase; +use function json_encode; +use function ob_flush; + +use const JSON_PRETTY_PRINT; + class ReadOperationsTest extends TestCase { protected function setUp(): void @@ -198,8 +203,13 @@ public function testQueryLog(): void Movie::where('imdb.rating', '>', 8.5)->get(); $logs = DB::connection('mongodb')->getQueryLog(); + foreach ($logs as $log) { + echo json_encode($log, JSON_PRETTY_PRINT); + } // end-query-log + ob_flush(); + $logs = DB::connection('mongodb')->getQueryLog(); $this->assertNotNull($logs); } } From c7f2766a75fd36bbd569e7ab95b35c13a48b4bc8 Mon Sep 17 00:00:00 2001 From: rustagir Date: Fri, 21 Mar 2025 14:04:08 -0400 Subject: [PATCH 11/13] test --- .../includes/fundamentals/read-operations/ReadOperationsTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/includes/fundamentals/read-operations/ReadOperationsTest.php b/docs/includes/fundamentals/read-operations/ReadOperationsTest.php index 1cbf51039..3ff29d763 100644 --- a/docs/includes/fundamentals/read-operations/ReadOperationsTest.php +++ b/docs/includes/fundamentals/read-operations/ReadOperationsTest.php @@ -206,6 +206,7 @@ public function testQueryLog(): void foreach ($logs as $log) { echo json_encode($log, JSON_PRETTY_PRINT); } + // end-query-log ob_flush(); From 7d687f1c5f8e576ffe12960d86d58ef951985586 Mon Sep 17 00:00:00 2001 From: rustagir Date: Fri, 21 Mar 2025 14:21:33 -0400 Subject: [PATCH 12/13] test --- .../read-operations/ReadOperationsTest.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/docs/includes/fundamentals/read-operations/ReadOperationsTest.php b/docs/includes/fundamentals/read-operations/ReadOperationsTest.php index 3ff29d763..9b81061ed 100644 --- a/docs/includes/fundamentals/read-operations/ReadOperationsTest.php +++ b/docs/includes/fundamentals/read-operations/ReadOperationsTest.php @@ -209,8 +209,23 @@ public function testQueryLog(): void // end-query-log - ob_flush(); - $logs = DB::connection('mongodb')->getQueryLog(); $this->assertNotNull($logs); + $this->expectOutputRegex('/^' + . '\{' + . '\s*"query"\s*:\s*"\{\\\"find\\\"\s*:\s*\\\"movies\\\",\s*\\\"filter\\\"\s*:\s*\{\\\"title\\\"\s*:\s*\\\"Carrie\\\"\}\}",' + . '\s*"bindings"\s*:\s*\[\],' + . '\s*"time"\s*:\s*\d+' + . '\}' + . '\{' + . '\s*"query"\s*:\s*"\{\\\"find\\\"\s*:\s*\\\"movies\\\",\s*\\\"filter\\\"\s*:\s*\{\\\"year\\\"\s*:\s*\{\\\"\\$lt\\\"\s*:\s*\{\\\"\\$numberInt\\\"\s*:\s*\\\"2005\\\"\}\}\}\}",' + . '\s*"bindings"\s*:\s*\[\],' + . '\s*"time"\s*:\s*\d+' + . '\}' + . '\{' + . '\s*"query"\s*:\s*"\{\\\"find\\\"\s*:\s*\\\"movies\\\",\s*\\\"filter\\\"\s*:\s*\{\\\"imdb.rating\\\"\s*:\s*\{\\\"\\$gt\\\"\s*:\s*\{\\\"\\$numberDouble\\\"\s*:\s*\\\"8\.5\\\"\}\}\}\}",' + . '\s*"bindings"\s*:\s*\[\],' + . '\s*"time"\s*:\s*\d+' + . '\}' + . '$/x'); } } From 200a679507f997d2e127c006fa40dfc80c49ccf0 Mon Sep 17 00:00:00 2001 From: rustagir Date: Fri, 21 Mar 2025 14:21:46 -0400 Subject: [PATCH 13/13] formatting --- .../includes/fundamentals/read-operations/ReadOperationsTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/includes/fundamentals/read-operations/ReadOperationsTest.php b/docs/includes/fundamentals/read-operations/ReadOperationsTest.php index 9b81061ed..ebac8e7fe 100644 --- a/docs/includes/fundamentals/read-operations/ReadOperationsTest.php +++ b/docs/includes/fundamentals/read-operations/ReadOperationsTest.php @@ -10,7 +10,6 @@ use MongoDB\Laravel\Tests\TestCase; use function json_encode; -use function ob_flush; use const JSON_PRETTY_PRINT;