File tree Expand file tree Collapse file tree 4 files changed +81
-0
lines changed Expand file tree Collapse file tree 4 files changed +81
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,12 @@ Sort the Returned Documents
16
16
If the query bar displays the :guilabel:`Sort` option, you can specify
17
17
the sort order of the returned documents.
18
18
19
+ .. note::
20
+
21
+ If you specify a sort order in the Query Bar, the specified sort order
22
+ overrides the :ref:`default sort order <compass-sort-query-bar>` you set
23
+ in :guilabel:`Settings`.
24
+
19
25
.. BEGIN-COMPASS-ONLY
20
26
21
27
Compatibility
Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ Learn more
67
67
Command Line Options </settings/command-line-options>
68
68
Configuration File Settings </settings/config-file>
69
69
Block Outgoing Connections </settings/restrict-outgoing-connections>
70
+ Set Default Sort Order </settings/set-default-sort>
70
71
Show Kerberos Password </settings/show-kerberos-password>
71
72
Hide Credentials </settings/protect-connection-strings>
72
73
Block Write Operations </settings/read-only>
Original file line number Diff line number Diff line change
1
+ .. _compass-sort-query-bar:
2
+
3
+ ======================
4
+ Set Default Sort Order
5
+ ======================
6
+
7
+ .. contents:: On this page
8
+ :local:
9
+ :backlinks: none
10
+ :depth: 2
11
+ :class: singlecol
12
+
13
+ You can specify a default sort order for documents shown in Compass through the
14
+ :guilabel:`Settings` panel.
15
+
16
+ .. note::
17
+
18
+ If you specify a sort order through a query in the Query Bar, the sort order
19
+ that you specify in the query overrides the default sort order.
20
+
21
+ If you :ref:`save a query <compass-favorite-queries>`, Compass does not save
22
+ the default sort order as part of the saved query.
23
+
24
+ About This Task
25
+ ---------------
26
+
27
+ You can choose one of the following default sort options:
28
+
29
+ .. list-table::
30
+ :header-rows: 1
31
+ :stub-columns: 1
32
+ :widths: 20 80
33
+
34
+ * - Sort Key
35
+ - Description
36
+
37
+ * - $natural: 1
38
+ - Sort in the natural order of documents
39
+
40
+ * - $natural: -1
41
+ - Sort in reverse natural order of documents
42
+
43
+ * - _id: 1
44
+ - Sort in ascending order by the ``_id`` field
45
+
46
+ * - _id: -1
47
+ - Sort in descending order by the ``_id`` field
48
+
49
+ Procedure
50
+ ---------
51
+
52
+ .. procedure::
53
+ :style: normal
54
+
55
+ .. include:: includes/fact-navigate-to-settings.rst
56
+
57
+ .. step:: Open the :guilabel:`Default Sort for Query Bar` dropdown menu.
58
+
59
+ .. step:: Select the default sort order you would like to use.
60
+
61
+ .. step:: Click :guilabel:`Save`.
62
+
63
+ .. note::
64
+
65
+ If you do not specify a default sort order, Compass uses the MongoDB server
66
+ default sort order of ``$natural: 1``, unless otherwise specified in the
67
+ Query Bar.
68
+
Original file line number Diff line number Diff line change @@ -79,6 +79,12 @@ You can configure the following settings on the |compass| interface:
79
79
80
80
To learn more, see :ref:`compass-protect-connection-strings`.
81
81
82
+ * - Default Sort for Query Bar
83
+ - General
84
+ - Defines how Compass sorts documents.
85
+
86
+ To learn more, see :ref:`compass-sort-query-bar`.
87
+
82
88
* - Show Kerberos Password Field
83
89
- General
84
90
- Show or hide the Kerberos password field on the |compass-short|
You can’t perform that action at this time.
0 commit comments