fixed date export in the js

This commit is contained in:
michael 2025-10-21 07:58:39 -05:00
parent 4e25d4a68e
commit 055c744862

View file

@ -118,8 +118,20 @@ const pipeline = [
}
},
total_messages: { $ifNull: ["$usageSummary.totalMessages", 0] },
first_used: "$usageSummary.firstUsed",
last_used: "$usageSummary.lastUsed"
first_used: {
$cond: {
if: { $ne: ["$usageSummary.firstUsed", null] },
then: { $dateToString: { format: "%Y-%m-%dT%H:%M:%S.%LZ", date: "$usageSummary.firstUsed" } },
else: null
}
},
last_used: {
$cond: {
if: { $ne: ["$usageSummary.lastUsed", null] },
then: { $dateToString: { format: "%Y-%m-%dT%H:%M:%S.%LZ", date: "$usageSummary.lastUsed" } },
else: null
}
}
}
}
},