MongoDB Import Tool
The MongoDB import tool provided by RazorSQL allows users to easily import data into MongoDB databases. The following import options are supported:
- Files of JSON insert statements: the MongoDB import tool will read each insert
statement from the file and execute it against the MongoDB database. The following is an example
of a MongoDB JSON insert statement:
test.employee.insert({"ssn" : 123456789 , "fname" : "John" , "minit" : "B" , "lname" : "Smith" , "address" : "731 Fondren, Houston TX" , "gender" : "M" , "salary" : 30000.0 , "mgrssn" : 333445555 , "dept_no" : 5}); - Files of JSON documents: the import tool will read the documents from the file
and convert them into JSON insert syntax and then execute them against the MongoDB database. The following
is an example of JSON document syntax:
{ "_id" : { "$oid" : "4e6ebee58b96ae35f1bea8fb"} , "ssn" : 123456789 , "fname" : "John" , "minit" : "B" , "lname" : "Smith" , "address" : "731 Fondren, Houston TX" , "gender" : "M" , "salary" : 30000.0 , "mgrssn" : 333445555 , "dept_no" : 5};
The MongoDB import tool prompts the user for information about the database and collection to which the import the data. It allows users to specify whether or not to halt on error. Users can also choose to not actually update the data, but instead write the generated SQL insert statements to an output file for later execution.
RazorSQL also offers many other MongoDB tools such as a MongoDB database browser, an MongoDB query builder, and much more. See the main MongoDB Features Page for more information.