Skip to content

Commit 8dc6565

Browse files
authored
Merge pull request #54 from steveren/DOCSP-2592
DOCSP-2592: Schema page revisions
2 parents 0ad5116 + cb3d396 commit 8dc6565

File tree

5 files changed

+79
-32
lines changed

5 files changed

+79
-32
lines changed
38.4 KB
Loading
24.4 KB
Loading
12.5 KB
Loading

source/includes/extracts-query-bar.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
ref: query-bar-results
2-
content: |
3-
For large query result sets, the results are shown from a sampled set
4-
of documents. Otherwise, Compass shows the entire result set.
2+
content: |
3+
For query result sets larger than 1000 documents, Compass
4+
shows a sampling of the results. Otherwise, Compass
5+
shows the entire result set.
56
67
For details on sampling, see the :ref:`FAQ <compass-faq-sampling>`.
78
---
89
ref: query-bar-type-schema
910
content: |
1011
You can type MongoDB queries into the query bar. In the query
11-
expression, you can use the various MongoDB :manual:`query operators
12-
</reference/operator/query/>` except for the :query:`$text` query
13-
operator.
12+
expression, you can use any MongoDB :manual:`query operator
13+
</reference/operator/query/>` except :query:`$text`.
1414
1515
As you type, the :guilabel:`Analyze` button is disabled and the
1616
:guilabel:`Filter` label turns red until a valid query is entered.

source/schema.txt

Lines changed: 73 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,55 @@ Schema
1414

1515
.. _schema-tab:
1616

17-
Schema Tab
18-
----------
19-
20-
The :guilabel:`Schema` tab reports on the documents in the collections.
21-
The report is based on :ref:`sampling of the documents
22-
<compass-faq-sampling>` in the collection.
17+
Schema Tab Overview
18+
-------------------
19+
20+
The :guilabel:`Schema` tab provides an overview of the data type
21+
and shape of the fields in a particular collection. Databases
22+
and collections are visible in the left-side navigation.
23+
24+
The overview is based on :ref:`sampling <compass-faq-sampling>`
25+
the documents in the collection. The schema overview may include
26+
additional data about the contents of the fields, such as the
27+
minimum and maximum values of dates and integers, the frequency of
28+
occurrence of particular values, and the cardinality of the data.
29+
30+
MongoDB has a :manual:`flexible schema model
31+
</core/data-modeling-introduction/>`, which means that some fields may
32+
contain different types of data from one document to the next. For
33+
example, a field named ``address`` may contain strings and integers
34+
in some documents, objects in others, or some combination of all three.
35+
In the case of heterogenous fields, the :guilabel:`Schema` tab shows a
36+
breakdown of the various data types contained within the field with the
37+
percentage of each data type represented.
38+
39+
In the example below, the :guilabel:`Schema` tab shows size
40+
information about the ``test.restaurants`` collection at the top,
41+
including the total number of documents in the collection, the
42+
average document size, and the total disk space occupied by the
43+
collection.
44+
45+
The following fields are shown with details:
46+
47+
- The ``_id`` field is an :manual:`ObjectId
48+
</reference/bson-types/index.html#objectid>`. Each ObjectId
49+
contains a timestamp, so Compass displays the range of creation times
50+
for the sampled documents.
51+
52+
- The ``address`` field contains four nested fields. You
53+
can expand the field panel to see analyses of each of the nested
54+
fields.
55+
56+
- The ``borough`` field contains a string indicating the borough in
57+
which the restaurant is located. The cardinality is low enough
58+
that Compass can provide a graded bar of the field contents, with the
59+
most-frequently occurring string on the left.
60+
61+
- The ``categories`` field contains arrays of strings. The analysis
62+
shows the minimum, maximum, and average array lengths.
2363

2464
.. figure:: /images/compass/collection-schema.png
25-
:figwidth: 817px
26-
27-
To access the :guilabel:`Schema` tab for a collection, click on a
28-
collection on the left hand pane and select the :guilabel:`Schema` tab.
65+
:figwidth: 750px
2966

3067
Query Bar
3168
---------
@@ -34,9 +71,10 @@ Query Bar
3471

3572
.. include:: /includes/extracts/query-bar-results.rst
3673

37-
From the :doc:`query bar </query-bar>` in the :guilabel:`Schema` tab, you can specify the
38-
query, and if you click the :guilabel:`Options`, you can also specify
39-
query options.
74+
Using the :doc:`query bar </query-bar>` in the :guilabel:`Schema` tab,
75+
you can create a query filter to limit your result set. Click the
76+
:guilabel:`Options` button to specify query options, such as the
77+
particular fields to display and the number of results to return.
4078

4179
.. figure:: /images/compass/query-bar-schema-view.png
4280
:figwidth: 730px
@@ -48,27 +86,30 @@ query options.
4886
In the :guilabel:`Schema` tab, you can also use the :ref:`build-query` to
4987
enter a query into the query bar.
5088

51-
Charts
52-
------
89+
Field Descriptions
90+
------------------
5391

54-
For a field, Compass displays the data types and values with various
55-
charts. The data type information is on the left hand side; the field
56-
value information is on the right.
92+
For each field, Compass displays summary information about the data
93+
type or types the field contains and the range of values. Depending
94+
on the data type and the level of cardinality, Compass displays
95+
histograms, graded bars, geographical maps, and sample data to provide
96+
a sense of the shape and scope of the data contained in each field.
5797

58-
Field with Single Type Values
98+
Field with a Single Data Type
5999
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
60100

61-
Below is an example of a chart showing a field called ``last_login``
62-
which contains data of type ``date``.
101+
Below is an example of the data type summary for a field called
102+
``last_login`` which contains data of type ``date``.
63103

64104
.. figure:: /images/compass/field-example.png
65105
:figwidth: 330px
66106

67-
Field with Multiple Type Values
68-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
107+
Field with Multiple Data Types
108+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
69109

70-
The charts also display a percentage breakdown for fields with varying
71-
data types across documents. In the example below,
110+
For fields that contain multiple data types,
111+
Compass displays a percentage breakdown of
112+
the various data types across documents. In the example below,
72113
the chart shows the contents of a field called ``phone_no`` in which
73114
81% of documents are of type ``string``, and the remaining 19% are of
74115
type ``number``.
@@ -122,7 +163,7 @@ Numbers
122163
~~~~~~~
123164

124165
Numbers are similar to strings in their representation.
125-
Entirely unique numbers are shown in the following manner:
166+
Unique numbers are shown in the following manner:
126167

127168
.. figure:: /images/compass/number-sample.png
128169
:figwidth: 764px
@@ -198,6 +239,9 @@ Query Builder
198239

199240
In the :guilabel:`Schema` tab, you can type the filter manually into
200241
the query bar or generate the filter with the Compass query builder.
242+
The query builder allows you to select data elements from one or more
243+
fields in your schema and construct a query matching the selected
244+
elements.
201245

202246
.. tip::
203247

@@ -209,6 +253,9 @@ Composing ``$OR`` filter conditions is not yet possible with the
209253
clickable query builder, but you can manually enter them in the query
210254
bar.
211255

256+
The following procedure describes the steps involved in
257+
building a complex query with the query bar.
258+
212259
.. include:: /includes/steps/create-query-via-builder.rst
213260

214261
.. note::

0 commit comments

Comments
 (0)