-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Fully Compatible
-
ALL
-
-
Execution Team 2022-12-12, Execution Team 2022-11-28, Execution Team 2022-12-26
In jstests/aggregation/extras/utils.js.
The function anyEq (and in turn arrayEq) considers mongo shell types (NumberLong/NumberInt/ObjectId, ...) elements as equal. This is caused by these having all properties as inherited, so no actual comparisons are made for the values within documentEq that arrayEq/anyEq uses to compare objects.
[js_test:arrayEqTest] dl NumberLong(4) dr NumberLong(5) [js_test:arrayEqTest] property in dl floatApprox is own false [js_test:arrayEqTest] property in dl top is own false [js_test:arrayEqTest] property in dl bottom is own false [js_test:arrayEqTest] property in dl exactValueString is own false [js_test:arrayEqTest] property in dl tojson is own false [js_test:arrayEqTest] documentEq: these are equal: NumberLong(4) == NumberLong(5)
[js_test:arrayEqTest] dl { "a" : NumberInt(1) } dr { "a" : NumberInt(1) } [js_test:arrayEqTest] property in dl a is own true [js_test:arrayEqTest] dl NumberInt(1) dr NumberInt(1) [js_test:arrayEqTest] property in dl tojson is own false [js_test:arrayEqTest] documentEq: these are equal: NumberInt(1) == NumberInt(1) [js_test:arrayEqTest] anyEq: these are equal: NumberInt(1) == NumberInt(1) [js_test:arrayEqTest] documentEq: these are equal: { "a" : NumberInt(1) } == { "a" : NumberInt(1) } [js_test:arrayEqTest] anyEq: these are equal: { "a" : NumberInt(1) } == { "a" : NumberInt(1) } [js_test:arrayEqTest] dl { "b" : NumberInt(2) } dr { "b" : NumberInt(4) } [js_test:arrayEqTest] property in dl b is own true [js_test:arrayEqTest] dl NumberInt(2) dr NumberInt(4) [js_test:arrayEqTest] property in dl tojson is own false [js_test:arrayEqTest] documentEq: these are equal: NumberInt(2) == NumberInt(4) [js_test:arrayEqTest] anyEq: these are equal: NumberInt(2) == NumberInt(4) [js_test:arrayEqTest] documentEq: these are equal: { "b" : NumberInt(2) } == { "b" : NumberInt(4) } [js_test:arrayEqTest] anyEq: these are equal: { "b" : NumberInt(2) } == { "b" : NumberInt(4) } [js_test:arrayEqTest] 2022-08-10T16:33:46.733Z assert failed : arrayEq not working as expected.
- depends on
-
SERVER-71572 Verify window_functions_on_timeseries_coll.js correctness
- Closed
-
SERVER-71574 Verify jstests/aggregation/sources/densify/decimal.js
- Closed
-
SERVER-71575 Verify jstests/aggregation/sources/densify/partitions.js
- Closed
- related to
-
SERVER-57605 Expose Decimal128 equality comparison helper to shell
- Closed