*** Using mongoimport
mongoimport --db artmapr --collection arts --type json --file models/sf_data.json --jsonArray
- cd /usr/local
- RUN mongod (in separate terminal window)
- ./bin/mongo
-
db
- show dbs (lists all databases)
- use artmapr (switches to artmapr database)
Here are THREE options to load data into MongoDB:
Client side: Angular level Automate lots of user inputs Server side: Nodejs + Express + Mongoose Define the schema in Mongoose, create the objects, save each one Database side: Mongodb Make a json file with the data, and import it directly into Mongo: mongoimport -d db_name -c collection_name --jsonArray --file jsonfilename.json