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

150
Vistas
mongodb pull from array without using $in

I seem to be able to pull elements from an array of objects by an object's field without using $in and I'm not sure why. I've written two tests that prove it works but it seems crazy to me. Is this valid?

Suppose the model { items: [ { name: '1', id: 1 }, { name: '2', id: 2 } ] }

I am incredibly surprised this works without $in: [1,2]

model.updateOne({_id}, { $pull: { items: {id: [1,2] } } })

Am I getting false positives on my tests? I see the array change, etc..

about 4 years ago · Juan Pablo Isaza
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