Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added source/images/compass/export-modal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/images/compass/export-schema-button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions source/includes/export-output-expanded.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.. code-block:: json
:linenos:
:copyable: false

"year": {
"type": "integer",
"x-bsonType": "int",
"x-metadata": {
"hasDuplicates": true,
"probability": 0.95,
"count": 950,
},
"x-sampleValues": [ "2003", "2020", "2023" ]
},
30 changes: 30 additions & 0 deletions source/includes/export-output-mongodb.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.. code-block:: json
:linenos:
:copyable: false

{
$jsonSchema: {
bsonType: "object",
required: ["title", "year"],
properties: {
_id: {
bsonType: "objectId"
},
title: {
bsonType: "string",
description: "Title must be a string",
},
year: {
bsonType: "int",
description: "Year must be an integer"
},
genres: {
bsonType: "array",
items: {
bsonType: "string"
},
description: "Genres must be an array of strings"
},
}
}
}
27 changes: 27 additions & 0 deletions source/includes/export-output-standard.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.. code-block:: json
:linenos:
:copyable: false

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": ["title", "year"],
"properties": {
"_id": {
"type": "string",
"description": "MongoDB's ObjectId"
},
"title": {
"type": "string"
},
"year": {
"type": "number"
},
"genres": {
"type": "array",
"items": {
"type": "string"
}
},
}
}
39 changes: 39 additions & 0 deletions source/includes/schema-export-format-expanded.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
MongoDB format schema objects contain the following fields:

.. list-table::
:header-rows: 1
:widths: 25 35 40

* - Property
- Data type
- Description

* - ``type``
- string
- Data type of the field.

* - ``x-bsonType``
- string or array
- |bson| type of this field.

* - ``x-metadata``
- document
- Document containing metadata about the field.

* - ``x-metadata.hasDuplicates``
- boolean
- ``true`` if a single value of this data type appears multiple
times in the corresponding field. Otherwise ``false``.

* - ``x-metadata.probability``
- float
- Probability that the value of the corresponding field is this
data type in a random document.

* - ``x-metadata.count``
- integer
- Number of documents sampled from the collection.

* - ``x-sampleValues``
- array
- Sample values as Expanded JSON.
1 change: 1 addition & 0 deletions source/includes/schema-export-format-mongodb.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TODO
44 changes: 44 additions & 0 deletions source/includes/schema-export-format-standard.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Standard format schema objects contain the following fields:

.. list-table::
:header-rows: 1
:widths: 25 35 40

* - Property
- Data type
- Description

* - ``type``
- string or array
- |bson| type of this data type. For details, see the `official JSON
docs <https://json-schema.org/draft/2020-12/json-schema-validation#name-type>`_.

* - ``anyOf``
- string
- For details, see the `official JSON docs
<https://json-schema.org/draft/2020-12/json-schema-core#name-anyof>`_.

* - ``required``
- string or array
- Fields that must appear in the schema. For details, see the
`official JSON docs <https://json-schema.org/draft/2020-12/json-schema-validation#name-required>`_.

* - ``properties``
- document
- Properties for each field, such as ``type`` and ``description``.
For details, see the `official JSON docs
<https://json-schema.org/draft/2020-12/json-schema-core#section-10.3.2.1>`_.

* - ``properties.<field>.type``
- string
- The data type of the ``<field>``.

* - ``properties.<field>.description``
- string
- Human-readable description of the ``<field>``.

* - ``properties.<field>.items``
- document
- Types of elements in array fields. For details, see the `official
JSON docs <https://json-schema.org/draft/2020-12/json-schema-core#section-10.3.1.2>`_.

Loading
Loading