i want to create a json output from mongodb by mongodbexport
it act correctly in terminal by this command :
sudo mongoexport --db mydb --collection url_db --query '{"state": "processed"}' --out /mongodb_json/name.JSON
but how can i use it in a shell script or in a python by subprocess.call
i use this code in python :
call(["mongoexport", "--db","mydb","--collection","url_db","--query","'{\"state\": \"processed\"}'","--out ",outfile],shell=True)
but it create this error: "no collection specified!" ,"Export MongoDB data to CSV, TSV or JSON files."
thank you