HomeDevCentral

Adding Collection::getAll() and Collection::count()
c9bd2cc11349Unpublished

Unpublished Commit · Learn More

Repository Importing: This repository is still importing.

Description

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.

Details

Provenance
derecksonAuthored on
Parents
rOBSIDIAN549ca4459824: Cleaning: Split core.php in two parts
Branches
Unknown
Tags
Unknown