Hello Enthusiast,
I am implementing data schema. Here i have to mention default value to a field of document.
is there any possible way to set default value to a field?
db.createCollection("collect", {
validator: {
$jsonSchema: {
bsonType: "object",
additionalProperties: true,
required: ["component", "path"],
properties: {
component: {
bsonType: "string"
},
path: {
bsonType: "string",
description: "Set to default value"
}
}
}
)
Best Regards,
M Jagadeesh.