We can then iterate over the dataset, but since the view only returns the document ID and we need more information, we fetch the full document through the get() method. If it actually finds a document by the given ID, we convert the JSON string to a PHP array and add it to the list of beers. The list is then passed on to the template to display it.