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

183
Views
MongoDB restore warning

I'm following this tutorial to backup and restore a single MongoDB database.

The backup command -

sudo mongodump --db newdb --out /var/backups/mongobackups/`date +"%m-%d-%y"`

The restore command -

sudo mongorestore --db newdb --drop /var/backups/mongobackups/01-20-16/newdb/

Although it works perfectly, MongoDB gives me this warning while restoring the data -

the --db and --collection args should only be used when restoring from a BSON file. Other uses are deprecated and will not exist in the future; use --nsInclude instead

Can someone explain how to remove this warning?

I'm using MongoDB 3.4.1 version.

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

--nsInclude is new in mongo 3.4.

Instead of older options where db_name and collection_name are given in command line as

mongorestore --db db_name --collection collection_name

namespaces are to be used

mongorestore --nsInclude db_name.collection_name

Similarly

mongorestore --db newdb --drop /var/backups/mongobackups/01-20-16/newdb/

becomes

mongorestore --nsInclude 'newdb.*' --drop /var/backups/mongobackups/01-20-16/
over 4 years ago · Santiago Trujillo Report

0

just execute command like this:

sudo mongorestore /var/backups/mongobackups/01-20-16
over 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!