-
Notifications
You must be signed in to change notification settings - Fork 76
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
base: master
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for docs-compass ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
c7be04e
to
8e662ac
Compare
63cf8ba
to
ce8320d
Compare
|
||
* - ``type`` | ||
- string or array | ||
- |bson| type of this data type. For details, see the `official JSON |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this property would contain JSON schema type, not BSON type. We'll be converting BSON type to standard JSON Schema type (when possible), or referring to a relaxed extended EJSON definition when not (https://www.mongodb.com/docs/manual/reference/mongodb-extended-json).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Example simple type:
"year": {
"type": "integer"
}
vs
"year": {
"bsonType": "int"
}
Example complex type (can't be easily described via JSON type):
"_id": {
"$ref": "#/$defs/ObjectId"
},
vs
"_id": {
"bsonType": "objectId"
},
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Updated.
docs <https://json-schema.org/draft/2020-12/json-schema-validation#name-type>`_. | ||
|
||
* - ``required`` | ||
- string or array |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- string or array | |
- array of strings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one must be an array
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
@jmd-mongo The descriptions were a stretch goal and we haven't included them in the end. |
* - ``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>`_. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part doesn't make sense.
Properties exist for type: object
, they are an object where keys are the fields and values are subschemas (we don't need to go into details with properties.<field>.type
, because in fact there can be many levels of sub-schemas). Items exist for type: array
. Items are subschema.
I also need to note that this is not an exhaustive list. It might make sense to list the most common fields, but we need to highlight that we're following a the JSON Schema Draft 2020-12 specification.
- ``true`` if a single value of this data type appears multiple | ||
times in the corresponding field. Otherwise ``false``. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- ``true`` if a single value of this data type appears multiple | |
times in the corresponding field. Otherwise ``false``. | |
- ``true`` if a single value appears multiple | |
times in this field. Otherwise ``false``. |
- Probability that the value of the corresponding field is this | ||
data type in a random document. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Probability that the value of the corresponding field is this | |
data type in a random document. | |
- Probability that the field exists in a random document. |
|
||
* - ``x-metadata.count`` | ||
- integer | ||
- Number of documents sampled from the collection. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Number of documents sampled from the collection. | |
- Number of documents from the sample that have this field |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These descriptions fit better the level of a field type. This could still exist for mixed types, but on the field level this description fits better.
43b855a
to
b08af02
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the discussion on this one earlier, @paula-stacho! This one is ready for another look when you have time.
Thanks,
Joe
b71b36f
to
cfbb26f
Compare
DESCRIPTION
Compass Export Schema.
STAGING
Export Your Schema
JIRA
https://jira.mongodb.org/browse/DOCSP-41772
Self-Review Checklist
External Review Requirements
What's expected of an external reviewer?