Method: XGen::Mongo::Driver::Collection#count
- Defined in:
- lib/mongo/collection.rb
#count(selector = {}) ⇒ Object
Return the number of records that match selector. If selector is nil or an empty hash, returns the count of all records.
161 162 163 |
# File 'lib/mongo/collection.rb', line 161 def count(selector={}) @db.count(@name, selector || {}) end |