Long accumulator instead of Double in MongoDB group() function
问题 I am using MongoDB via official Java API. I can store and retrive Long values without any extra effort. But when I try to accumulate these values using group() function, JavaScript interpreter converts everything into Doubles and the final result ends up being a Double. Here is my group command: { ... initial: { count: 0 }, reduce: "function (o, a) { a.count += o.count; }" } Is there a way to tell the interpreter that count is in fact a Long? Something like count: 0L or count: Long(0) ? Or