Details
-
Bug
-
Resolution: Won't Fix
-
Major - P3
-
None
-
2.4.9, 2.6.0-rc0
-
Query
-
ALL
Description
Some aggregation functions will turn any type into a string. This gives really strange results in an example like this:
db.foo.insert({i:1234567}); /* this is a float*/
|
db.foo.aggregate({$project:{_id:0, i:{$substr:["$i",0,3]}}}
|
{"i" : "1.2" }
|
Apparently it's because larger floats coerce to string of format 1.xxxe+xx
While $strcasecmp, $substr, $toLower and $toUpper all do this, only substr makes for such bizarre manifestation.
Attachments
Issue Links
- related to
-
SERVER-23410 Improve or remove support for dates in string expressions
-
- Closed
-