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

182
Views
function to remove all documents that the Age parameter is above 50

I'm working with VSC abd we started with MongoDB. We got an exercise that we need to remove all documents that the age in those documents are above 50. For example:

My code of adding the documents (which works): my code of adding the documents (which works)

I want to know how do I remove (if it's with DeleteMany() or other function) them so I'll be left with only the one document that his age is below 50.

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You need to use $gt operator

emloyees.deleteMany({ age: {$gt: 50}});
about 4 years ago · Santiago Trujillo Report
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!