-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 1.1.0
-
Component/s: None
-
None
3b6b96e implemented a TypeMapArrayIterator class for PHPLIB-112, which was meant to apply to non-cursor results from an aggregate command; however, that commit never removed logic in the constructor that prohibited specifying a typeMap option if useCursor was false. Additionally, it did not remove logic in Collection::aggregate() to avoid inheriting the Collection's type map if useCursor was false.
The fact that we never received bug reports for this is an indicator that there are likely very few users specifying a custom type map and/or disabling aggregation cursors. Additionally, there were no reports after 1.1.0 that non-cursor aggregate results were using PHPC's default type map (e.g. stdClass and arrays).
In any event, both bits of logic above should be removed, despite non-cursor aggregation being deprecated in PHPLIB-304.
Additionally, it'd be helpful to add a test for applying a type map to an inline aggregation operation, since that would have caught this sooner. That test should only run on servers before 3.6, since 3.6+ raises an error for inline aggregations.
- is related to
-
PHPLIB-304 Deprecate methods and classes related to inline results for the aggregate command
- Closed
-
PHPLIB-112 Configurable type map for findAndModify and non-cursor aggregate commands
- Closed