[CDRIVER-3292] mongoc_collection_count_documents does not prepend empty $match Created: 09/Aug/19  Updated: 28/Oct/23  Resolved: 09/Aug/19

Status: Closed
Project: C Driver
Component/s: libmongoc
Affects Version/s: None
Fix Version/s: 1.15.0

Type: Bug Priority: Major - P3
Reporter: Kevin Albertson Assignee: Kevin Albertson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Epic Link: C 4.2 Support

 Description   

This was discovered in expectation comparisons of retryable reads.

The logic of countDocuments here:
https://github.com/mongodb/specifications/blob/master/source/crud/crud.rst#countdocuments

Indicates we should always prepend the $match, even if a user does not provide a filter.



 Comments   
Comment by Githook User [ 09/Aug/19 ]

Author:

{'name': 'Kevin Albertson', 'username': 'kevinAlbs', 'email': 'kevin.albertson@10gen.com'}

Message: CDRIVER-3292 always prepend match to countDocuments pipeline
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/9bc4b5c838815086bd3fab9c6e7e5e834af40f0a

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