使用MongoBee验证MongoDB中文档的迁移

时间:2018-09-27 15:21:03

标签: java spring mongodb spring-boot

我想使用MongoBee在Java中创建如下所示的验证,请帮助我

db.runCommand({
  collMod: “user”,
  validator: { $jsonSchema: {
  bsonType: "object",
  required: ["name”,”email”],
  properties: {
     name: {
        bsonType: "string",
        description: "must be a string and is required"
     },
     Email: {
        bsonType: "string",
        description: "must be a string and is required"
     }
  }
}},
  validationLevel: "moderate"
})

0 个答案:

没有答案