0 votes
1 view
in Web Technology by (47.8k points)

I want to load data/restore dump data in mongoDB using mongorestore. I am trying to command

mongorestore dump

but it giving me an error

Sat Sep 21 16:12:33.403 JavaScript execution failed: SyntaxError: Unexpected identifier

How can we restore or put data into mongoDB?? Please give me the steps.

2 Answers

0 votes
by (107k points)

You can use the mongodump: To dump all the records:

mongodump -db databasename

0 votes
by (80.9k points)

You can take a dump to your local machine using the following syntax:

mongodump -h <host>:<port> -u <username> -p <password> -d ubertower-new -o /path/to/destination/directory

And for restoring from the local machine to your Mongo DB using the following command:

mongorestore -h <host>:<port> -u <username> -p <password> -d <DBNAME> /path/to/destination/directory/<DBNAME>

Related questions

0 votes
3 answers
0 votes
1 answer
asked Oct 18, 2019 in Web Technology by Sammy (47.8k points)
0 votes
1 answer
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...