-
Type: Bug
-
Resolution: Won't Fix
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.4.9, 2.6.0-rc0
-
Component/s: Aggregation Framework
-
Query
-
ALL
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.
- related to
-
SERVER-23410 Improve or remove support for dates in string expressions
- Closed