db.COLLECTION.update(
{
$expr: {$eq: [{"$type": "$YOUR_DATE_FIELD"}, "object"]},
},
{$set: {
"YOUR_DATE_FIELD": new Date(parseInt("$YOUR_DATE_FIELD.$date.$numberLong")),
}},
{
multi: true,
upsert: false,
}
);
Original issue:
Uncaught MinimongoError: Key $date must not start with '$'
No comments:
Post a Comment