[JAVA-4530] Use the count command instead of collStats to implement estimatedDocumentCount Created: 11/Mar/22  Updated: 28/Oct/23  Resolved: 04/May/22

Status: Closed
Project: Java Driver
Component/s: CRUD
Affects Version/s: None
Fix Version/s: 4.7.0

Type: Improvement Priority: Major - P3
Reporter: PM Bot Assignee: Jeffrey Yemin
Resolution: Fixed Votes: 0
Labels: QP-priority
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
Issue split
split from DRIVERS-2228 Use the count command instead of coll... Closed
Server Compat: 5.0, 5.3, 6.0
Quarter: FY23Q2
Upstream Changes Summary:

DRIVERS-2228:
Drivers should update their estimatedDocumentCount implementations to use the count command, regardless of the wire version of the connected server. The unified CRUD tests, legacy retryable reads tests, Atlas Data Lake tests, and the versioned API spec tests will need to be synced to mongodb/specifications@021cbc8. Lastly, the "Count API Details" section of the CRUD spec includes some documentation and release notes requirements that drivers will need to adhere to.

Backwards Compatibility: Fully Compatible
Documentation Changes: Needed
Documentation Changes Summary:

I think this requirement from the spec belongs in release notes or reference docs, not API docs:

Drivers MUST document that, due to an oversight in versions 5.0.0-5.0.8 of MongoDB, the count command, which estimatedDocumentCount uses in its implementation, was not included in v1 of the Stable API, and so users of the Stable API with estimatedDocumentCount are recommended to upgrade their server version to 5.0.9+ or set apiStrict: false to avoid encountering errors.


 Description   

This ticket was split from DRIVERS-2228, please see that ticket for a detailed description.



 Comments   
Comment by Githook User [ 04/May/22 ]

Author:

{'name': 'Jeff Yemin', 'email': 'jeff.yemin@mongodb.com', 'username': 'jyemin'}

Message: Always use count command for estimatedDocumentCount (#929)

JAVA-4530
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/4e0b91635125956723abc2dc2e934c4a45766a8e

Generated at Thu Feb 08 09:02:19 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.