Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

260
Vistas
How can I delete the validation rule appiled to my collection?

I am new to mongodb and I am trying out the document validators that the database itself provides. Here is the command that I have written

db.runCommand({
  collMod: "admin",
  validator: {
    $or : [
      { isActive : { $type : "bool" }},
    ],

    $and: [
      { name : { $type : "string" }},
      { mobileNumber : { $type : "int" }},
    ]
  },
  validationAction: "error",
  validationLevel: "strict"
});

So it executed perfectly and I can see it in getCollectionInfo command but now I want to delete this rule but I can't find the method to do it anywhere.

How do I delete this ? Also is there any method which can apply validators to collection which exists as well as non existing collections ?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

You should be able to do this by setting the validation level to off

db.runCommand({
   collMod: "admin",
   validator: {},
   validationLevel: "off"
})

Where collMod is the name of your collection

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda