Hi,
There is an explanation that uses this in $project
stage to truncate to 1 digit:
{
$project: {
thing: {
$divide: [{ $trunc: { $multiply: ["$thing", 10] } }, 10]
}
}
},
I don’t quite follow. Why?
This is what I did which led to same results:
{
$project: { thing: { $trunc: ["$thing", 1] } }
}
Am I missing something? Doesn’t $trunc: [<field>, <places>]
do exactly the same?