I have a file named services.json containing a data base that I exported from a windows mongodb, and I want to import that file into robomongo (connected to mongodb installed by npm) on Ubuntu.
I'm a beginner and I don't know how to proceed, which terminal use (robomongo or Ubuntu)?
To import JSON file you need to follow the following steps: Step 1: Open a command prompt and give command mongod to connect with MongoDB server and don't close this cmd to stay connected to the server. Step 2: Open another command prompt and run the mongo shell. Using the mongo command.
To import data to a MongoDB database, you can use mongoimport to import specific collections data, or you can use mongorestore to import a binary (BSON) full database backup. The exported database file must be stored locally on the same machine as your client.
Creating the MongoDB Database in Robo 3T GUI To create a new MongoDB database, right-click on the New Connection and select Create Database in the pop-up menu. The “Create Database” window will appear asking the user to enter the desired database name in the “Database Name” field.
RoboMongo is just the UI for your mongod which is the primary daemon process for the MongoDB system. Apart from this you can import using the mongoimport command from terminal. Show activity on this post. if this is not a bson, and only json, you can use mongoimport --jsonArray . refference Insert json file into mongodb Show activity on this post.
It's not really a JSON format that ROBO 3T accepts, but rather bunch of JSON objects separated by newlines. (if you use export Standard, then it's already formatted for document insert) Show activity on this post. RoboMongo is just the UI for your mongod which is the primary daemon process for the MongoDB system.
Creating the first Collection in the MongoDB Database using Robo 3T Once the database is created, click the arrow on the left-side of the testDatabase then right click on the Collections(0) folder (0 means no collection) and select the Create Collection... in the menu.
It's not really a JSON format that ROBO 3T accepts, but rather bunch of JSON objects separated by newlines. (if you use export Standard, then it's already formatted for document insert)
to import data for a collection in Robomongo:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With