-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 1.4.0
-
Component/s: JavaScript
-
None
Seeding a group call with a 64bit integer will produce unwanted results. Instead of summing on an integer field, it will concatenate strings.
Example
Collection:
This will work in mongo console, because size is seeded with a 32bit integer or a double
db.file.group({key :
, cond :
{ch : "channelname"}, reduce : function(doc,out)
{out.size += doc.size;}, initial : {size : 0}})
If a driver uses a 64 bit integer, the reduce function is going to go like this (printjson output):
{ "ch" : "eph.eph.main", "size" :
{ "floatApprox" : 0 }}
{ "ch" : "eph.eph.main", "size" : "[object Object]23810924" } { "ch" : "eph.eph.main", "size" : "[object Object]2381092418479807" } { "ch" : "eph.eph.main", "size" : "[object Object]23810924184798075661612" }{
"ch" : "eph.eph.main",
"size" : "[object Object]238109241847980756616124350139"
}
{
"ch" : "eph.eph.main",
"size" : "[object Object]2381092418479807566161243501392645007"
}
{
"ch" : "eph.eph.main",
"size" : "[object Object]23810924184798075661612435013926450074783518"
}
{
"ch" : "eph.eph.main",
"size" : "[object Object]2381092418479807566161243501392645007478351815558296"
}
.....