The following aggregation runs on a MongoDB instance and it appears each stage and operation is supported by CosmosDB.
The documents in my collection look like the following:
{
_id:5eb465210e56cee76582f9a3,
tz:"America/New_York",
islanderName:"Aydrian",
islandName:"Echo Creek"
}
I'm trying to run the following aggregation:
[
{
$addFields: {
currentHour: {
$hour: {
date: new Date(now),
timezone: "$tz",
},
},
},
},
{
$match: {
currentHour: 16,
},
},
]
With a UTC date string as the now variable.
When I try to run this against CosmosDB I get the Can't convert from BSON type to date Error. Is this a bug? Is something not supported? Is there a work around? Thanks