From 683acd2756609ce71865125177e5a0f0cfe284fe Mon Sep 17 00:00:00 2001 From: ian fogelman Date: Tue, 17 Aug 2021 11:04:20 -0400 Subject: [PATCH] DOCSP-18006 Add behavior section to cursor pretty page --- source/reference/method/cursor.pretty.txt | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/source/reference/method/cursor.pretty.txt b/source/reference/method/cursor.pretty.txt index 4106c18913b..7674d4ad7ba 100644 --- a/source/reference/method/cursor.pretty.txt +++ b/source/reference/method/cursor.pretty.txt @@ -19,7 +19,8 @@ Definition .. include:: /includes/fact-mongosh-shell-method.rst - Configures the cursor to display results in an easy-to-read format. + Configures the cursor to display results in a format that + is easy to read. The :method:`~cursor.pretty()` method has the following prototype form: @@ -27,6 +28,15 @@ Definition db.collection.find().pretty() + +Behavior +-------- + +The :method:`~cursor.pretty()` method: + +- Does not change the output format in :binary:`~bin.mongosh`. +- Changes the output format in the :ref:`legacy mongo shell`. + Examples -------- @@ -48,7 +58,7 @@ By default, :method:`db.collection.find()` returns data in a dense format: { "_id" : ObjectId("54f612b6029b47909a90ce8d"), "title" : "A Tale of Two Cities", "text" : "It was the best of times, it was the worst of times, it was the age of wisdom, it was the age of foolishness...", "authorship" : "Charles Dickens" } By using :method:`cursor.pretty()` you can set the cursor to return data in a -format that is easier for humans to parse: +format that is easier to read: .. code-block:: javascript