Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOCSP-41772-export-schema #731

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
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.
3 changes: 3 additions & 0 deletions source/includes/addl-json-fields.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This is not an exhaustive list of all possible fields. For details on
additional fields, see the
`official JSON Schema spec <https://json-schema.org/draft/2020-12>`_.
107 changes: 107 additions & 0 deletions source/includes/export-output-expanded.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
.. code-block:: json
:linenos:
:copyable: false

{
"type": "object",
"x-bsonType": "object",
"required": [
"_id",
"title",
"year"
],
"properties": {
"_id": {
"$ref": "#/$defs/ObjectId",
"x-bsonType": "objectId",
"x-metadata": {
"hasDuplicates": false,
"probability": 1,
"count": 3
},
"x-sampleValues": [
"573a1391f29313caabcd7616",
"573a1392f29313caabcd9c1b",
"573a1390f29313caabcd6223"
]
},
"genres": {
"type": "array",
"x-bsonType": "array",
"x-metadata": {
"hasDuplicates": true,
"probability": 0.3333333333333333,
"count": 1
},
"items": {
"type": "string",
"x-bsonType": "string",
"x-metadata": {
"hasDuplicates": false,
"probability": 1,
"count": 2
},
"x-sampleValues": [
"drama",
"horror"
]
}
},
"plot": {
"type": "string",
"x-bsonType": "string",
"x-metadata": {
"hasDuplicates": false,
"probability": 0.6666666666666666,
"count": 2
},
"x-sampleValues": [
"Salome, the daughter of Herodias, seduces her step-father/uncle Herod, ...",
"Gwen's family is rich, but her parents ignore her and most of the serv..."
]
},
"title": {
"type": "string",
"x-bsonType": "string",
"x-metadata": {
"hasDuplicates": false,
"probability": 1,
"count": 3
},
"x-sampleValues": [
"Salomè",
"Payment Deferred",
"The Poor Little Rich Girl"
]
},
"year": {
"type": "integer",
"x-bsonType": "int",
"x-metadata": {
"hasDuplicates": false,
"probability": 1,
"count": 3
},
"x-sampleValues": [
1922,
1932,
1917
]
}
},
"$defs": {
"ObjectId": {
"type": "object",
"properties": {
"$oid": {
"type": "string",
"pattern": "^[0-9a-fA-F]{24}$"
}
},
"required": [
"$oid"
],
"additionalProperties": false
}
}
}
34 changes: 34 additions & 0 deletions source/includes/export-output-mongodb.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.. code-block:: json
:linenos:
:copyable: false

{
"$jsonSchema": {
"bsonType": "object",
"required": [
"_id",
"title",
"year"
],
"properties": {
"_id": {
"bsonType": "objectId"
},
"genres": {
"bsonType": "array",
"items": {
"bsonType": "string"
}
},
"plot": {
"bsonType": "string"
},
"title": {
"bsonType": "string"
},
"year": {
"bsonType": "int"
}
}
}
}
48 changes: 48 additions & 0 deletions source/includes/export-output-standard.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
.. code-block:: json
:linenos:
:copyable: false

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": [
"_id",
"title",
"year"
],
"properties": {
"_id": {
"$ref": "#/$defs/ObjectId"
},
"genres": {
"type": "array",
"items": {
"type": "string"
}
},
"plot": {
"type": "string"
},
"title": {
"type": "string"
},
"year": {
"type": "integer"
}
},
"$defs": {
"ObjectId": {
"type": "object",
"properties": {
"$oid": {
"type": "string",
"pattern": "^[0-9a-fA-F]{24}$"
}
},
"required": [
"$oid"
],
"additionalProperties": false
}
}
}
36 changes: 36 additions & 0 deletions source/includes/schema-export-format-expanded.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Expanded format schema objects contain these fields in addition to the
Standard Schema fields:

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

* - Property
- Data type
- Description

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

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

* - ``hasDuplicates``

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* - ``hasDuplicates``
* - ``x-metadata.hasDuplicates``

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

- boolean
- ``true`` if a single value appears multiple times in this
field. Otherwise ``false``.

* - ``probability``

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* - ``probability``
* - ``x-metadata.probability``

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

- float
- Probability that the field exists in a random document.

* - ``count``

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* - ``count``
* - ``x-metadata.count``

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

- integer
- Number of documents from the sample that have this field.

* - ``x-sampleValues``
- array
- Sample values as Expanded JSON. Sample values are limited to
the first 100 characters.
27 changes: 27 additions & 0 deletions source/includes/schema-export-format-mongodb.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
MongoDB format schema objects contain the following fields:

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

* - Property
- Data type
- Description

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

* - ``required``
- array of strings
- Fields that must appear in the schema.

* - ``properties``
- document
- Properties for each field. Keys are property names and values are
subschemas.

* - ``items``
- document
- Metadata about elements in array fields. Metadata appears as
embedded subschemas.
32 changes: 32 additions & 0 deletions source/includes/schema-export-format-standard.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Standard format schema objects contain the following fields:

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

* - Property
- Data type
- Description

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

* - ``required``
- array of strings
- 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``
- object
- Properties for each field. Keys are property names and values are
subschemas. For details, see the `official JSON docs
<https://json-schema.org/draft/2020-12/json-schema-core#section-10.3.2.1>`_.

* - ``items``
- document
- Metadata about elements in array fields. Metadata appears as
embedded subschemas. For details, see the `official
JSON docs <https://json-schema.org/draft/2020-12/json-schema-core#section-10.3.1.2>`_.

Loading
Loading