Skip to content

Commit aaf40e8

Browse files
committed
DOCSP-3622: $jsonSchema type keyword does not support "integer", use bsonType with "int" or "long" instead
1 parent dc1b353 commit aaf40e8

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

source/includes/fact-json-schema-validation-keywords.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.. list-table::
22
:header-rows: 1
3+
:widths: 15 15 20 50
34

45
* - Keyword
56
- Type
@@ -22,6 +23,10 @@
2223
- string or array of unique strings
2324
- Enumerates the possible JSON types of the field. Available types are
2425
"object", "array", "number", "boolean", "string", and "null".
26+
27+
MongoBD's implementation of the JSON Schema does not support the
28+
"integer" type. Use the ``bsonType`` keyword and the
29+
"int" or "long" types instead.
2530

2631
* - allOf
2732
- all types

source/reference/operator/query/jsonSchema.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ aggregation stage.
5353
Available Keywords
5454
~~~~~~~~~~~~~~~~~~
5555

56+
.. note::
57+
58+
MongoDB implements a subset of keywords available in JSON Schema.
59+
For a complete list of omissions, see :ref:`json-schema-omission`.
60+
5661
.. include:: /includes/fact-json-schema-validation-keywords.rst
5762

5863
Extensions
@@ -63,6 +68,8 @@ keyword, which allows you to use all :term:`BSON` types in the
6368
:query:`$jsonSchema` operator. ``bsonType`` accepts the same string aliases used
6469
for the :query:`$type` operator.
6570

71+
.. _json-schema-omission:
72+
6673
Omissions
6774
---------
6875

0 commit comments

Comments
 (0)