PDA

View Full Version : Run mongodb command on qt



ng2b30
23rd August 2018, 08:50
I use the following to run the command and I got that output. But I dun know why it is not correct and how can I change the Command to run successfully? Thank you.



FILE *fileProcess = popen(command.c_str(), "r");




mongoexport --host 192.168.2.10:27036 --db clement --collection hallo --out /home/clement/hallo.json --type json --query "{"_id" : { $lte : 1 }}" --limit 0 --skip 0 2>&1

2018-08-23T15:41:41.477+0800 error validating settings: query '[123 34 95 105 100 34 32 58 32 123 32 32 58 32 49 32 125 125]' is not valid JSON: invalid character ':' looking for beginning of object key string
2018-08-23T15:41:41.477+0800 try 'mongoexport --help' for more information