-
Type: Question
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Aggregation Framework
-
None
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 } } } ) );
- related to
-
SERVER-6203 Aggregation operators should have well defined implicit type coercion behavior.
- Backlog