alexbilbie/codeigniter-mongodb-library — pull request #17 by experience (2011-10-12 13:11:57+00:00)
Title: Optionally preserve `where` clauses when calling the `count` method

Hi,

I've added an optional second parameter (boolean) to the `count` method. If this parameter is `FALSE`, the `_clear` method is not called. Handy for code such as:

$this->mongo_db->where(array('foo' => 'bar'));
$total_count = $this->mongo_db->count('my_collection', FALSE);

$this->mongo_db->limit(100);
$results = $this->mongo_db->get('my_collection');

Cheers,
Stephen