Method: Mongo::Collection#estimated_document_count
- Defined in:
- lib/mongo/collection.rb
#estimated_document_count(options = {}) ⇒ Integer
Gets an estimate of the number of documents in the collection using the collection metadata.
Use #count_documents to retrieve the exact number of documents in the collection, or to count documents matching a filter.
751 752 753 |
# File 'lib/mongo/collection.rb', line 751 def estimated_document_count( = {}) View.new(self, {}, ).estimated_document_count() end |