Hi,
I perform a query which creates the collection “cons_2022_second_part”, so later I can use mongoexport to keep it as a csv file:
{ $match : {"meterConsumptionDeltas" : 0,
"meterId" : "22056.3"
,"receivedTime" : { $gte: ISODate("2022-12-28T00:00:00.004Z"),
$lte: ISODate("2022-12-31T00:23:59.004Z")}
}},
{$project: {"repeaterNumber":1,"meterConsumptionDeltas" : 1,"diameter":1,"externalName":1,"meterId":1,"receivedTime": 1} }
,{$out:"cons_2022_second_part"}
]);
The output table has 2 documents with these dates:
{
“meterId” : “22056.3”,
“externalName” : “01-200021386-14”,
“diameter” : 2,
“receivedTime” : ISODate(“2022-12-29T00:00:00.000+02:00”),
“meterConsumptionDeltas” : 0,
“repeaterNumber” : NumberLong(162)
},{
“meterId” : “22056.3”,
“externalName” : “01-200021386-14”,
“diameter” : 2,
“receivedTime” : ISODate(“2022-12-31T00:00:00.000+02:00”),
“meterConsumptionDeltas” : 0,
“repeaterNumber” : NumberLong(162)
}
However. when I use mongoexport, this is the dates shown:
mongoexport --db mydb --collection cons_2022_second_part --fields “meterId”,“externalName”,“diameter”,“receivedTime”,“meterConsumptionDeltas”,“repeaterNumber”
–username “myuser” --password “mypassword” --type csv --out cons_2022_second_part2.csv
meterId,externalName,diameter,customerName,receivedTime,meterConsumptionDeltas,repeaterNumber
22056.3,01-200021386-14,2,2022-12-30T22:00:00.000Z,0,162
22056.3,01-200021386-14,2,2022-12-28T22:00:00.000Z,0,162
why is the difference between the dates in output table and the csv?
Thanks