[DOCS-6874] Documented count().readConcern() syntax is not supported Created: 24/Dec/15  Updated: 30/Oct/23  Resolved: 15/Jan/16

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Bug Priority: Major - P3
Reporter: Stennie Steneker (Inactive) Assignee: Kyle Suarez
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to DOCS-6942 db.collection.count() does not mentio... Closed
is related to DOCS-6486 .readConcern() shell helper for db.co... Closed
Participants:
Days since reply: 7 years, 29 weeks ago

 Description   

DOCS-6486 mentions count() supporting a readConcern() helper in the mongo shell:

db.collection.count().readConcern(<level>)

This does not appear to match the implementation, which (as at MongoDB 3.2.0) only supports passing the readConcern to count() as an option, eg:

db.bacon.count({}, {readConcern: "local"})



 Comments   
Comment by Emily Hall [ 27/Jul/16 ]

Closed for housekeeping on 7/27/2016 by Emily Hall.
If you require additional support, please open a new ticket for prioritization.
Thanks,
Emily

Comment by Githook User [ 14/Jan/16 ]

Author:

{u'username': u'ksuarz', u'name': u'Kyle Suarez', u'email': u'kyle.suarez@mongodb.com'}

Message: DOCS-6874 fix count with read concern

The readConcern() shell helper does not work with db.collection.count(), as
the latter is not a cursor method. (It returns an integer.)

Instead, use the options parameter with db.collection.count() to specify a
read concern. You can also chain cursor.count() to a db.collection.find()
command with a read concern, like so:

db.collection.find().readConcern(<read-concern>).count()

Signed-off-by: kay <kay.kim@10gen.com>
Branch: master
https://github.com/mongodb/docs/commit/53d78f6e04263a31cefbca6a69471065d27dbd30

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