In MongoDB, I can set up a JSON Schema validation in a collection I create, such as these:
db.createCollection("teste", {
validator: {
jsonSchema: {
bsonType: "object",
required: ["campo1", "numero1"],
properties: {
campo1: {
bsonType: "string",
description: "Deve ser uma string"
},
numero1: {
bsonType: "string",
description: "Deve ser um texto"
},
}
}
}
})
But I have mixed-type collections that make use of the Polymorphic Pattern. Where I have something like five or more "types" of schema that are accepted in a collection.
Can I setup multiple JSON Schema validators in a collection? or just one?