MongoDB commands
Connect MongoDB on server
1. Use SSH to connect with port 22
2. Connect to MongoDB using command
# mongo
Show all the databases on the server
# show dbs
Connect to Database
# use <DB-NAME>
Show all collections
# show collections
Export all collections
# mongodump -d <DB-NAME> -o /<directory_to_export>
Restore all collections
# mongorestore -d <DB-NAME> /<directory_from_import>
Export single collection
# mongoexport –db <DB-NAME> –collection <COLLECTION-NAME> –out <COLLECTION-NAME>.json
Import single collection
# mongoimport –db <DB-NAME> –collection <COLLECTION-NAME> –file <COLLECTION-NAME>.json
Ready to Solve Your Most Complex Technical Challenges?
Our senior advisors are ready to help you navigate the ever-evolving technology landscape with precision and expertise.
Schedule a ConsultationRelated Articles
Create a project in Angular
Type following command to create a new project: # ng new <PROJECT-NAME> It will ask “Would you like to add Angular routing?…
Install NodeJs and Angular CLI
How to Install NodeJs and Angular CLI Steps for installing NodeJS Open https://nodejs.org/ Download the LTS version and install it. ( *LTS…
Firebase hosting setup for Angular app
1. Firstly install node.js on your machine. # sudo apt-get install nodejs # sudo apt-get install npm 2. To install the firebase…