[DOCS-11947] Docs for SERVER-35989: Mongo shell needs a countDocuments function Created: 07/Aug/18  Updated: 29/Oct/23  Resolved: 12/Sep/18

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: 4.0.3, 4.1.2

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

Issue Links:
Documented
documents SERVER-35989 Mongo shell needs a countDocuments fu... Closed
Related
related to DOCS-12090 new count helper restrictions Closed
Participants:
Days since reply: 5 years, 18 weeks, 1 day ago
Epic Link: DOCS: 4.2 Server/Tools

 Description   

----------------------------

Original Description

Description:

countDocuments function: returns the number of documents matching the filter
estimatedDocumentCount function: gets an estimate of the count of documents in a collection using collection metadata

https://github.com/mongodb/specifications/blob/master/source/crud/crud.rst#count-api-details

the count() helper is currently deprecated in the drivers, but we have not done so in the shell. There is a ticket for this: https://jira.mongodb.org/browse/SERVER-36436

Engineering Ticket Description:

countDocuments was a late change to the drivers for MongoDB 4.0 and is missing from the MongoDB Shell. Needs to be added in a future release.

----------------------------

Description

Scope of changes (files that need work and how much)

Add new pages

  • db.collection.countDocuments.txt
  • db.collection.estimatedDocumentCount.txt

+ redirect config/redirects and toc source/includes/ref-toc-method-collection.yaml

Add references

  • source/core/transactions
  • source/aggregation.
  • source/core/views.txt
  • source/includes/extracts-views.yaml
  • source/reference/command/count.txt
  • source/reference/method/db.collection.count.txt
  • source/reference/operator/aggregation/count.txt

Impact to other docs outside of this product

None

MVP (work and date?)

Resources (e.g. Scope Docs, Invision)



 Comments   
Comment by Githook User [ 09/Oct/18 ]

Author:

{'name': 'kay', 'email': 'kay.kim@10gen.com', 'username': 'kay-kim'}

Message: DOCS-11947: countDocuments and estimatedDocumentCount
Branch: master
https://github.com/mongodb/docs/commit/444178d5479bba296fddf7af5f5c1477da700986

Comment by Kay Kim (Inactive) [ 12/Sep/18 ]

Will merge in when 4.0.3.

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