[GODRIVER-506] Cursor does not expose Count Created: 20/Jul/18  Updated: 10/Sep/18  Resolved: 10/Sep/18

Status: Closed
Project: Go Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Gregoire Pean Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The JS API has a count() method on the cursor*, to return the count of matching objects in the collection even when you have a limit/skip associated with the find. This is very useful to not have to spawn separate Count operations in parallel with finds.



 Comments   
Comment by Kristofer Brandow (Inactive) [ 10/Sep/18 ]

Hi gpean,

What is implemented by the Node driver isn't any more efficient than doing a count on it's own, and the same is true of the Go driver. Additionally, not all cursors have a count associated with them. For instance, ChangeStreams return a Cursor but there is no way to count the number of documents ahead of time returned by a ChangeStream.

Thanks,

Kris

Generated at Thu Feb 08 08:34:21 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.