-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 4.2.1, 4.4.0, 5.0.0
-
Labels:
-
Environment:MacOS 11.2.3
Description
I was trying to set capped collection with limit of 2^32 - 1 (as it is stated in https://docs.mongodb.com/manual/reference/limits/#mongodb-limit-Maximum-Number-of-Documents-in-a-Capped-Collection), however I get the error message from the server "max in a capped collection has to be < 2^31". I dig in with my colleague and found that on server it is set to 2^31 - 1 indeed (https://github.com/mongodb/mongo/blob/master/src/mongo/db/catalog/collection_options.cpp#L117-L119). I also go over the jira issues over history and found these mentions:
https://jira.mongodb.org/browse/DOCS-795
https://jira.mongodb.org/browse/SERVER-5285
My colleague told me the documentation pointed that the limit is documented as 2^32-1 since 2.2 (https://docs.mongodb.com/v2.2/reference/limits/#Maximum-Number-of-Documents-in-a-Capped-Collection). I tried on 4.2 and 4.4 servers yet got the error message I mentioned above.
If I'm not wrong there is an anomaly in documentation which you may want to fix or maybe clarify it for me if I misunderstand.