Details
-
Question
-
Resolution: Done
-
Major - P3
-
None
-
None
-
None
Description
Right now when one integer is divided by another the result is a double, even if the exact (unrounded) result could be expressed as an integer. This may be ok / desirable, but wanted to check.
Test:
c = db.c;
|
c.drop();
|
|
|
c.save( { a:NumberLong(10) } );
|
printjson( c.aggregate(
|
// Divide 10 by 1
|
{ $project:{ z:{ $divide:[ '$a', NumberLong(1) ] } } },
|
// Match where z is of type double.
|
{ $match:{ z:{ $type:1 } } }
|
) );
|
Attachments
Issue Links
- related to
-
SERVER-6203 Aggregation operators should have well defined implicit type coercion behavior.
-
- Backlog
-