Skip to content

Commit c69a745

Browse files
committed
DOCSP-48249-export-schema
1 parent abdb28c commit c69a745

File tree

9 files changed

+217
-355
lines changed

9 files changed

+217
-355
lines changed
260 KB
Loading
117 KB
Loading
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.. code-block:: json
2+
:linenos:
3+
:copyable: false
4+
5+
"year": {
6+
"type": "integer",
7+
"x-bsonType": "int",
8+
"x-metadata": {
9+
"hasDuplicates": true,
10+
"probability": 0.95,
11+
"count": 950,
12+
},
13+
"x-sampleValues": [ "2003", "2020", "2023" ]
14+
},
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
.. code-block:: json
2+
:linenos:
3+
:copyable: false
4+
5+
{
6+
$jsonSchema: {
7+
bsonType: "object",
8+
required: ["title", "year"],
9+
properties: {
10+
_id: {
11+
bsonType: "objectId"
12+
},
13+
title: {
14+
bsonType: "string",
15+
description: "Title must be a string",
16+
},
17+
year: {
18+
bsonType: "int",
19+
description: "Year must be an integer"
20+
},
21+
genres: {
22+
bsonType: "array",
23+
items: {
24+
bsonType: "string"
25+
},
26+
description: "Genres must be an array of strings"
27+
},
28+
}
29+
}
30+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
.. code-block:: json
2+
:linenos:
3+
:copyable: false
4+
5+
{
6+
"$schema": "https://json-schema.org/draft/2020-12/schema",
7+
"type": "object",
8+
"required": ["title", "year"],
9+
"properties": {
10+
"_id": {
11+
"type": "string",
12+
"description": "MongoDB's ObjectId"
13+
},
14+
"title": {
15+
"type": "string"
16+
},
17+
"year": {
18+
"type": "number"
19+
},
20+
"genres": {
21+
"type": "array",
22+
"items": {
23+
"type": "string"
24+
}
25+
},
26+
}
27+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
MongoDB format schema objects contain the following fields:
2+
3+
.. list-table::
4+
:header-rows: 1
5+
:widths: 25 35 40
6+
7+
* - Property
8+
- Data type
9+
- Description
10+
11+
* - ``type``
12+
- string
13+
- Data type of the field.
14+
15+
* - ``x-bsonType``
16+
- string or array
17+
- |bson| type of this field.
18+
19+
* - ``x-metadata``
20+
- document
21+
- Document containing metadata about the field.
22+
23+
* - ``x-metadata.hasDuplicates``
24+
- boolean
25+
- ``true`` if a single value of this data type appears multiple
26+
times in the corresponding field. Otherwise ``false``.
27+
28+
* - ``x-metadata.probability``
29+
- float
30+
- Probability that the value of the corresponding field is this
31+
data type in a random document.
32+
33+
* - ``x-metadata.count``
34+
- integer
35+
- Number of documents sampled from the collection.
36+
37+
* - ``x-sampleValues``
38+
- array
39+
- Sample values as Expanded JSON.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
TODO
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
Standard format schema objects contain the following fields:
2+
3+
.. list-table::
4+
:header-rows: 1
5+
:widths: 25 35 40
6+
7+
* - Property
8+
- Data type
9+
- Description
10+
11+
* - ``type``
12+
- string or array
13+
- |bson| type of this data type. For details, see the `official JSON
14+
docs <https://json-schema.org/draft/2020-12/json-schema-validation#name-type>`_.
15+
16+
* - ``anyOf``
17+
- string
18+
- For details, see the `official JSON docs
19+
<https://json-schema.org/draft/2020-12/json-schema-core#name-anyof>`_.
20+
21+
* - ``required``
22+
- string or array
23+
- Fields that must appear in the schema. For details, see the
24+
`official JSON docs <https://json-schema.org/draft/2020-12/json-schema-validation#name-required>`_.
25+
26+
* - ``properties``
27+
- document
28+
- Properties for each field, such as ``type`` and ``description``.
29+
For details, see the `official JSON docs
30+
<https://json-schema.org/draft/2020-12/json-schema-core#section-10.3.2.1>`_.
31+
32+
* - ``properties.<field>.type``
33+
- string
34+
- The data type of the ``<field>``.
35+
36+
* - ``properties.<field>.description``
37+
- string
38+
- Human-readable description of the ``<field>``.
39+
40+
* - ``properties.<field>.items``
41+
- document
42+
- Types of elements in array fields. For details, see the `official
43+
JSON docs <https://json-schema.org/draft/2020-12/json-schema-core#section-10.3.1.2>`_.
44+

0 commit comments

Comments
 (0)