Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- db.createCollection("publishers", {
- validator: {
- $jsonSchema: {
- bsonType: "object",
- required: [ "name", "email_address", "status", "created_at" ],
- properties: {
- name: {
- bsonType: "string",
- description: "must be a string and is required",
- },
- email_address: {
- bsonType: "string",
- description: "must be a string and is required",
- },
- status: {
- enum: [ 1, 0 ],
- description: "must be either 0 or 1 and is required"
- },
- created_at: {
- bsonType: "int",
- description: "must be an integer and is required",
- }
- }
- }
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement