mongoexport multiple in condition errror showing in db showing error Failed: error parsing query as Extended JSON: i

51 Views Asked by At

AM getting below error in mongoexport, multiple conditions in connections need to export it's working fine in studio 3t but in mongoexport command line not coming in output please help

/u01/ba/mongo/mongoexport --host ui-west-prod-mongodb-ent1-vm-01.az.3pc.att.com:17345 --authenticationDatabase admin -u 'm425@[email protected]' -p 'prd@23' --readPreference secondaryPreferred --db entaction --collection statuses  --ssl --sslCAFile /u01/a1_cert.pub --sslAllowInvalidCertificates --type=csv -f "_id, tyId,Uid,uan,taskName,InsertTimestamp,UpdateTimestamp,results,status" -q '{"taskName" : {"$in": ["RT_WAP", "LI_WAP", "TI_SWAP"]}, "results" :{"$in": ["TIMEOUT","SUCCEEDED","FAILURE", "INPROGRESS", "SUCCESS"]}, "firstInsertTimestamp" : { "$gt" : ISODate("2024-02-13T00:00:01.000+0000")}}'  -o /u01/ent1_session_stats.csv
2024-02-15T05:25:26.175+0000    connected to: mongodb://ui-west-prod-mongodb-ent1-vm-01.az.3pc.att.com:1734/
2024-02-15T05:25:26.319+0000    Failed: error parsing query as Extended JSON: invalid JSON input. Position: 177. Character: I`

trying to complete mongoexport:- AM getting below error in mongoexport, multiple conditions in connections need to export it's working fine in studio 3t but in mongoexport command line not coming in output please help

/u01/ent1_session_stats.csv:

2024-02-15T05:25:26.175+0000    connected to: mongodb://ui-west-prod-mongodb-ent1-vm-01.az.3pc.att.com:1734/
2024-02-15T05:25:26.319+0000    Failed: error parsing query as Extended JSON: invalid JSON input. Position: 177. Character: I

below is connecting now if i have to pass date in variable how can i do that, as hardcode date taking but date in variable not taking:-

/u01/ba/mongo/mongoexport --host ui-west-prod-mongodb-ent1-vm-01.az.3pc.att.com:17345 --authenticationDatabase admin -u 
'm425@[email protected]' -p 'prd@23' --readPreference secondaryPreferred --db entaction --collection statuses  --ssl 
--sslCAFile /u01/a1_cert.pub --sslAllowInvalidCertificates --type=csv -f "_id, tyId,Uid,uan,taskName,InsertTimestamp,UpdateTimestamp,
results,status" -q '{"taskName" : {"$in": ["RT_WAP", "LI_WAP", "TI_SWAP"]}, "results" :{"$in": ["TIMEOUT","SUCCEEDED","FAILURE", 
"INPROGRESS", "SUCCESS"]},  "firstInsertTimestamp" :{"$gt" : {"$date": "2024-02-14T00:00:00.000Z"}}}'  -o /u01/ent1_session_stats.csv
0

There are 0 best solutions below