Showing posts with label Mongodb - Import JS file. Show all posts
Showing posts with label Mongodb - Import JS file. Show all posts

Wednesday, February 5, 2020

Mongodb - Import JS file

Importing database file in mongdb can be a headache if you haven't done it before. The most common way of exporting and importing database using commands mongodump and mongorestore. But what if you have js file to import.
Here is the way to import js file in mongo database.

Solution :

mongo 127.0.0.1/dbname exportedjsfilename.js