Trying to figure out why the addition of the query causes the parse to fail.
The original mongoexport command works fine:
mongoexport --uri=“mongodb+srv://username:password@abcd-uat-pl-0.i48a5.mongodb.net/DBTEST” --collection=“COLLTEST” --fields=“IssuingBank,amount,orderRef,paymentId,payMethod,receivedDate,status,transRef” --type=csv --out=“C:\MIB\Technology\PowerBI\mongodb\test1.csv”
2025-07-15T15:13:18.858+0800 connected to: mongodb+srv://[REDACTED]@abcd-uat-pl-0.i48a5.mongodb.net/DBTEST
2025-07-15T15:13:19.117+0800 exported 3354 records
When the --query option is added
mongoexport --uri=“mongodb+srv://username:password@abcd-uat-pl-0.i48a5.mongodb.net/DBTEST” --collection=“COLLTEST” --fields=“IssuingBank,amount,orderRef,paymentId,payMethod,receivedDate,status,transRef” –query=‘{“header.signedDate”: {“$gt”: {“$date”: “2025-06-19T00:00:00.000Z”}}}’ --type=csv --out=“C:\MIB\Technology\PowerBI\mongodb\test1.csv”
2025-07-15T15:57:26.733+0800 error parsing command line options: error parsing positional arguments: provide only one MongoDB connection string. Connection strings must begin with mongodb:// or mongodb+srv:// schemes
2025-07-15T15:57:26.783+0800 try ‘mongoexport --help’ for more information