Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

153
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!