agentejo / mongo-lite

Schemaless database on top of SQLite
160 stars 18 forks source link

count documents #11

Closed wormen closed 8 years ago

wormen commented 8 years ago

tell me how I can get the count of documents in the collection, not the full selected? eg the documentation is an example

$products = $collection->find();
$products->count()

so on large volumes of data will be noticeable brake

there is some variant like this?

$collection->count();

ie, in SQL, this query would look like this

select count(id) from table_name