Phactory\Mongo\Phactory::getAll PHP Method

getAll() public method

* Get results from the database as a cursor.
public getAll ( $collection_name, $query = [] )
$collection_name name of the collection
$query a MongoDB query
    public function getAll($collection_name, $query = array())
    {
        if (!is_array($query)) {
            throw new \Exception("\$query must be an associative array of 'field => value' pairs");
        }
        $collection = new Collection($collection_name, true, $this);
        return $collection->find($query);
    }