db.collection_name.aggregate([
{$addFields: {
"date_with_uniform_time": {$dateTrunc: {
date: "$source_date_field",
unit: "day",
timezone: "America/New_York",
}},
}},
{$addFields: {
"date_without_time": {$substr: [
"$date_with_uniform_time",
0, 10
]}
}},
]);
No comments:
Post a Comment