Skip to content

Commit c4bb1e4

Browse files
committed
DOCSP-41059-validation-update
1 parent 9b1907e commit c4bb1e4

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

source/validation.txt

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -150,21 +150,20 @@ exception of the following query operators: :query:`$near`,
150150

151151
{
152152
$or: [
153-
{ phone: { $type: "string" } },
154-
{ email: { $regex: /@mongodb\.com$/ } },
155-
{ status: { $in: [ "Unknown", "Incomplete" ] } }
153+
{ name: { $type: "string" } },
154+
{"borough": {
155+
"bsonType": "string",
156+
"enum": [ "Manhattan", "Brooklyn", "Queens", "Bronx", "Staten Island" ],
157+
"description": "must be one of the enum strings"
158+
} }
156159
]
157160
}
158161

159162
Using this validation, *one* of the following must be true:
160163

161-
- The ``phone`` field must be BSON type string,
162-
163-
- The ``email`` field must match the
164-
:manual:`regex </reference/operator/query/regex/>`
165-
``/@mongodb\.com$/``, or
164+
- The ``name`` field must be BSON type string.
165+
- The ``borough`` field must be one of the enum strings.
166166

167-
- The ``status`` field must be either ``Unknown`` or ``Incomplete``.
168167

169168
.. _validation-actions-levels:
170169

0 commit comments

Comments
 (0)