Advertisement
Aldin-SXR

Schema validation (query operators)

Oct 14th, 2019
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 0.27 KB | None | 0 0
  1. db.createCollection("publishers", {
  2.     validator: {
  3.         $and: [
  4.             { name: { $type: "string" } },
  5.             { email_address: { $type: "string" } },
  6.             { status: { $in: [ 1, 0 ] } },
  7.             { created_at: { $type: "int" } }
  8.         ]
  9.     }
  10. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement