进一步完善校验规则
对于数据库中已经存在集合可使用 collMod 来修改集合从而添加对应的 validator 校验规则
对应类似于 validator 与版本相关的特性在数据库升降级过程中需要预先进行处理...: "object",required: [ "name", "age", "sex" ],properties: {name: {bsonType: "string",description: "must... be a string and is required"},age: {bsonType: "int",minimum: 0,maximum: 125,exclusiveMaximum: false}...: {name: {bsonType: ["string","int"]},age: {bsonType: "int",minimum: 0,maximum: 125,exclusiveMaximum:...普通唯一性索引只能在单分片中起到唯一性约束的作用,跨分片无法做唯一性检查或者说实现代价太大。
如何理解 MongoDB 中_id 值不采用严格自增 ID 的方式生成?