[CDRIVER-3933] Create consistent reply for estimatedDocumentCount Created: 17/Mar/21  Updated: 28/Oct/23  Resolved: 31/Mar/21

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 1.18.0, 1.18.0-alpha

Type: Bug Priority: Major - P3
Reporter: Benji Rewis (Inactive) Assignee: Benji Rewis (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

As of CDRIVER-3905 mongoc_collection_estimated_document_count can return a different server response format depending on whether the command was run against < 4.9 or 4.9+.

Create a consistent format for the reply of estimatedDocumentCount. Additionally, the spec only requires us to return an int, so we should investigate the usage of this returned response.

Also, investigate the error that could be returned with a successful but malformed reply in estimated document count.



 Comments   
Comment by Githook User [ 31/Mar/21 ]

Author:

{'name': 'Benjamin Rewis', 'email': '32186188+benjirewis@users.noreply.github.com', 'username': 'benjirewis'}

Message: CDRIVER-3933 Reinit reply in estimatedDocumentCount for NamespaceNotFound (#766)
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/a9afdeb0d58dfb5ac60be699442f17fde6f78dd9

Comment by Benji Rewis (Inactive) [ 24/Mar/21 ]

After an offline discussion, we decided to allow the two different formats, but destroy and re-initialize "reply" in the case of a NamespaceNotFound error.

 

PR: https://github.com/mongodb/mongo-c-driver/pull/766

Generated at Wed Feb 07 21:19:26 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.