Hi,
I’m trying to understand that on this link : https://docs.mongodb.com/manual/core/schema-validation/
For this code below, if I understand well, with the operator $or: It means that if one of the field in the list is validate during insert or update, it will be correct ? Can you give me more explanation plase.
db.createCollection( "contacts",
{ validator: { $or:
[
{ phone: { $type: "string" } },
{ email: { $regex: /@mongodb\.com$/ } },
{ status: { $in: [ "Unknown", "Incomplete" ] } }
]
}
} )
Thank you.