I am trying to import data into MongoDB through Python envoy. However it keeps showing "permission denied". After I have changed the permission of the data file, it keeps showing "Exec format error".
However, when I ran the same command on MongoDB Shell, everything works well.
Do you know how can I run the commands through Python envoy?
Below is my code:
def load_data():
data_file = os.path.join(os.getcwd(), 'enron.mbox.json')
print data_file
r = envoy.run('mongoimport --db enron --collection mbox --drop --file %s' % data_file)
print r.std_out
print sys.stderr.write(r.std_err)