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

640
Vistas
MongoDB Compass does not allow ObjectId() while populating DB with "Insert Document" feature?

I am using MongoDB Compass version 1.25.0.

I was trying to insert a document shared by one of my colleague using the "Insert Document" feature of the MongoDB Compass.

But, it's showing that the document is not in correct format. enter image description here

I think it is validating JSON format and ObjectId() is not a valid JSON value.

I am aware that Compass would create ObjectId() automatically but I want to pass it explicitly.

I resorted to the Shell and I was able to insert the document.

My question is does MongoDB Compass allow entering ObjectId() from the UI? If yes, what am I doing wrong?

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

0

I was able to insert a document with ObjectId using below syntax:

{
    "_id": {
        "$oid": "60261ccf416a1ed478d7357a"
    }
}

I found that the documentation of a bit off in clarifying how the $oid is supposed to be used. At least for someone beginner like me.

enter image description here

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