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

131
Views
Mongo DB show all collections except one

in Mongo DB how can I retrieve all documents except one which is Test

my code shows all the documents

db.getCollectionNames().forEach(function(collection) { 
    var result = db[collection]; 
    if(result != 'Test') { 
        print("All the documents: " + " for collection: "+ collection);
    } 
});
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The correct is:

  db.getCollectionNames().forEach(function(collection){
     if(collection != 'Test') {
         print("All the documents: " + " for collection: "+ collection);
        }
       }
      );
about 4 years ago · Juan Pablo Isaza 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!