[DOCS-14662] Investigate changes in SERVER-57321: $mod match expression incorrectly handles NaN, Infinity and large values Created: 20/Jul/21  Updated: 13/Nov/23  Resolved: 19/Oct/21

Status: Closed
Project: Documentation
Component/s: manual, Server
Affects Version/s: None
Fix Version/s: 5.0.4, 4.4.10, 5.1.0-rc0, Server_Docs_20231030, Server_Docs_20231106, Server_Docs_20231105, Server_Docs_20231113

Type: Task Priority: Major - P3
Reporter: Backlog - Core Eng Program Management Team Assignee: Jason Price
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
documents SERVER-57321 $mod match expression incorrectly han... Closed
Participants:
Days since reply: 2 years, 12 weeks, 1 day ago
Epic Link: DOCSP-14300
Story Points: 3

 Description   
Downstream Change Summary

$mod match expression semantics was changed to:
(1) for dividend parameter - to not match a document if dividend value is either NaN or Infinity; to throw an exception if the rounded dividend value cannot be represented as a 64-bit integer;
(2) for divisor, remainder parameters - to throw an exception if value is either NaN or Infinity, or the rounded value cannot be represented as a 64-bit integer.

Description of Linked Ticket

In classic variant of query execution $mod match expression (ModMatchExpression) interprets dividend value NaN (double) as -9223372036854775808 64-bit integer. In SBE, on the other hand, NaN to 64-bit integer transformation results in Nothing.  Furthermore, NumberDecimal("9.999999999999999999999999999999999E+6144") gets interpreted as NumberLong("-9223372036854775808") (classic and SBE). Those two factors, when combined, give unexpected results.  Please see "Steps to Reproduce".

 



 Comments   
Comment by Githook User [ 16/Nov/21 ]

Author:

{'name': 'jason-price-mongodb', 'email': '69260375+jason-price-mongodb@users.noreply.github.com', 'username': 'jason-price-mongodb'}

Message: DOCS-14662 mod match expression values (#6024)

Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com>
Branch: v5.0
https://github.com/mongodb/docs/commit/edbf308650c86dccedfadb046c3492cc8e68f2a9

Comment by Githook User [ 16/Nov/21 ]

Author:

{'name': 'jason-price-mongodb', 'email': '69260375+jason-price-mongodb@users.noreply.github.com', 'username': 'jason-price-mongodb'}

Message: DOCS-14662 mod match expression values (#6017) (#6018)

Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com>

Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com>
Branch: v5.0
https://github.com/mongodb/docs/commit/e02502b0ffdec67c4565c0545f7f9c1512a0e4c2

Comment by Githook User [ 25/Oct/21 ]

Author:

{'name': 'jason-price-mongodb', 'email': '69260375+jason-price-mongodb@users.noreply.github.com', 'username': 'jason-price-mongodb'}

Message: DOCS-14662 mod match expression values (#6044)

Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com>
Branch: v4.4
https://github.com/mongodb/docs/commit/de60c04da7cc8233f5a2a601b19561a21cbd4cd0

Comment by Githook User [ 19/Oct/21 ]

Author:

{'name': 'jason-price-mongodb', 'email': '69260375+jason-price-mongodb@users.noreply.github.com', 'username': 'jason-price-mongodb'}

Message: DOCS-14662 mod match expression values (#6024)

Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com>
Branch: v5.0.4
https://github.com/mongodb/docs/commit/0823a904b689fe8849e61c2d31c973938d9368b9

Comment by Githook User [ 19/Oct/21 ]

Author:

{'name': 'jason-price-mongodb', 'email': '69260375+jason-price-mongodb@users.noreply.github.com', 'username': 'jason-price-mongodb'}

Message: DOCS-14662 mod match expression values (#6022)

DOCS-14662 mod match expression values

Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com>
Branch: master
https://github.com/mongodb/docs/commit/ae928831985709ddb983712812250115a2a74ea2

Comment by Githook User [ 18/Oct/21 ]

Author:

{'name': 'jason-price-mongodb', 'email': '69260375+jason-price-mongodb@users.noreply.github.com', 'username': 'jason-price-mongodb'}

Message: DOCS-14662 mod match expression values (#6017) (#6018)

Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com>

Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com>
Branch: v5.0.4
https://github.com/mongodb/docs/commit/9036c9a52130581c8576b63e8aaeddb42c6cc1d9

Comment by Githook User [ 18/Oct/21 ]

Author:

{'name': 'jason-price-mongodb', 'email': '69260375+jason-price-mongodb@users.noreply.github.com', 'username': 'jason-price-mongodb'}

Message: DOCS-14662 mod match expression values (#6017)

Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com>
Branch: master
https://github.com/mongodb/docs/commit/1ca8ebab3fbe43440c66763af9b5e8d4e88c3762

Comment by PM Bot [ 25/Aug/21 ]

Downstream changes updated for upstream SERVER-57321:
$mod match expression semantics was changed to:
(1) for dividend parameter - to not match a document if dividend value is either NaN or Infinity or if the rounded dividend value cannot be represented as a 64-bit integer;
(2) for divisor, remainder parameters - to throw an exception if value is either NaN or Infinity, or the rounded value cannot be represented as a 64-bit integer.

Generated at Thu Feb 08 08:10:54 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.