i am new in mongodb. i am creating free database using mongolab. my database name is enron and this database i have create on collection name is mbox. my system have one json file.i am trying to import this json file into collection using python.my database connection connect sucessfully but importing json file then error occure.please give me proper solution.
import os
import sys
import envoy
from bson import json_util # Comes with pymongo
from pymongo import MongoClient
client = pymongo.MongoClient('mongodb://user:[email protected]:33499/enron')
r = pymongo.MongoClient('mongoimport --host mongolab.com --port 033499 --username pramod_jadhav --password p9822581103 --collection mbox --db enron --file C:\Users\sachin\Documents\IPython \ch06-mailboxes\data\enron.mbox.json')
print 'json import sucessfully'
mongoimportin this way. Just run it from the command line. - Neil Lunn