Adding Collection::getAll() and Collection::count()
[ Feature description ]
The Collection classes should now implement two new methods:
- count() — Gets a count of the documents in the collection
- getAll() — Gets all the documents from the collection
[ Implementation for FilesCollection and MongoDBCollection ]
- FilesCollection::count() counts the number of *.json files in the collection directory, getAll() returns a Generator to read each directory *.json file.
- MongoDBCollection::count() calls MongoCollection::count(), MongoDBCollection::getAll() returns an Iterator which calls systematically the MongoCursor Iterator, except to return the current object, for which it calls MongoCursor:Current but then returns an instance of CollectionDocument.
[ Unit testing ]
The collections tests cover these new methods.