File tree Expand file tree Collapse file tree 5 files changed +51
-9
lines changed Expand file tree Collapse file tree 5 files changed +51
-9
lines changed Original file line number Diff line number Diff line change @@ -25,14 +25,14 @@ level: 4
25
25
ref : view-session-log
26
26
content : |
27
27
28
- |mdb-shell| saves the log for each session to your user's
29
- ``.mongodb/mongosh`` directory:
30
-
31
28
.. tabs::
32
29
33
30
.. tab::
34
31
:tabid: macOS and Linux
35
32
33
+ |mdb-shell| saves the log for each session to your user's
34
+ ``.mongodb/mongosh`` directory:
35
+
36
36
.. code-block:: sh
37
37
38
38
~/.mongodb/mongosh/<LogID>_log
@@ -62,7 +62,10 @@ content: |
62
62
tail -f ~/.mongodb/mongosh/<LogID>_log | pino-colada
63
63
64
64
.. tab::
65
- :tabid: windows
65
+ :tabid: Windows
66
+
67
+ |mdb-shell| saves the log for each session to your user's
68
+ ``C:\Users\<username>\AppData\Local\`` directory:
66
69
67
70
.. code-block:: sh
68
71
Original file line number Diff line number Diff line change @@ -36,6 +36,11 @@ Procedure
36
36
37
37
.. include:: /includes/steps/install-shell-windows.rst
38
38
39
+ .. note::
40
+
41
+ ``mongosh`` preferences are stored by default in the directory
42
+ ``C:\Users\<username>\AppData\Roaming``.
43
+
39
44
.. tab::
40
45
:tabid: macos
41
46
@@ -101,6 +106,11 @@ Procedure
101
106
102
107
.. include:: /includes/steps/install-shell-linux-generic.rst
103
108
109
+ .. important:: Windows Users
110
+
111
+ ``mongosh`` preferences are stored by default in the directory
112
+ ``C:\Users\<username>'\.mongodb\mongosh``.
113
+
104
114
Next Steps
105
115
----------
106
116
Original file line number Diff line number Diff line change @@ -395,12 +395,17 @@ Cursor Methods
395
395
396
396
.. arrayAccess
397
397
398
- * - :method:` cursor.batchSize()`
398
+ * - `` cursor.batchSize()` `
399
399
400
400
- Controls the number of documents MongoDB will return to the
401
401
client in a single network message.
402
402
403
- .. clone
403
+ The following example query returns results in batches of
404
+ 100:
405
+
406
+ .. code-block:: sh
407
+
408
+ db.myCollection.find().batchSize(100)
404
409
405
410
* - :method:`cursor.close()`
406
411
@@ -697,6 +702,24 @@ Native Methods
697
702
698
703
- Description
699
704
705
+ * - ``print()``
706
+
707
+ - Print the specified text or variable. ``print()`` and ``printjson()``
708
+ are aliases for ``console.log()``.
709
+
710
+ .. code-block:: code
711
+
712
+ > print("hello world")
713
+ hello world
714
+
715
+ > x = "example text"
716
+ > print(x)
717
+ example text
718
+
719
+ * - ``sleep()``
720
+
721
+ - Suspends the |mongo| shell for a given period of time.
722
+
700
723
* - ``version()``
701
724
702
725
- Returns the current version of the ``mongosh`` instance.
Original file line number Diff line number Diff line change @@ -47,6 +47,12 @@ the server.
47
47
provides consistent behavior by always throwing an exception in these
48
48
scenarios.
49
49
50
+ Clear the ``mongosh`` Console
51
+ -----------------------------
52
+
53
+ The ``cls`` command clears the console. You can also clear the console
54
+ with ``Ctrl + L`` and ``console.clear()``.
55
+
50
56
.. toctree::
51
57
:titlesonly:
52
58
Original file line number Diff line number Diff line change 1
1
.. _mdb-shell-write-scripts:
2
2
3
- =================================
4
- Write Scripts for the ``mongosh``
5
- =================================
3
+ =============================
4
+ Write Scripts for ``mongosh``
5
+ =============================
6
6
7
7
.. default-domain:: mongodb
8
8
You can’t perform that action at this time.
0 commit comments