[COMPASS-6372] $limit (aggregation) value has unexpected/undocumented max value Created: 13/Dec/22  Updated: 14/Jun/23

Status: Open
Project: Compass
Component/s: Aggregation pipeline, Atlas, CRUD, Embedded Shell
Affects Version/s: 1.34.1
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Cast Away Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Fedora linux, compass git tag v1.34.1 built on host, local mongodb server (v6.1.0) and also MongoDB Atlas server.


Issue Links:
Related
is related to NODE-3391 EJSON.stringify does not stringify Lo... Backlog
is related to COMPASS-4884 Exporting collections with int64 resu... Closed
Story Points: 5

 Description   

Problem Statement/Rationale

Aggregation stage ...

$limit stage

{$limit: 9223372036854775807}

... doesn't work - there is an error reported.

$limit stage

{$limit: 9223372036854775295}

... seems to be the maximum number that does not produce an error, although, I'm not confident that number is actually sent to the server.  I observed port 27017 packets with wireshark and noted unusual 64-bit numbers being sent to the server for the $limit value.  Packets sent by pymongo looked normal and expected.

Steps to Reproduce

Enter $limit stage as above and observe error.

Expected Results

Accept 2^63-1 as valid $limit value

Actual Results

Error message

Additional Notes

This bug also applies to mongosh, the mongosh in compass, and MongoDB Atlas aggregation.

This bug does NOT appear in pymongo.


Generated at Wed Feb 07 22:42:52 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.