6.3 PHP

To access MongoDB from PHP 7.1 on Ubuntu 17.10, the php-mongodb extension was installed using the command:

sudo apt-get install php-mongodb

To test access to MongoDB by PHP, was written a script that performs the same query as in item 4.3., that is, it shows the repeated titles of the documents, sorted by quantity and title.

The PHP script code is in the file: titulos_repetidos.php

The output of the execution is shown below:

Avenida Central; 2
Casa da Ópera; 2
Chafariz da Praça Quinze de Novembro; 2
Chafariz da Praça São Salvador; 2
Chafariz das Saracuras; 2
Cidade Nova; 2
Copacabana; 2
Igreja de São Francisco de Paula; 2
Morro da Viúva; 2
Ouro Preto; 2
Santa Luzia; 2
São Roque; 2
Chafariz das Marrecas; 3
Quinta da Boa Vista; 3
Floresta da Tijuca; 4
Largo da Carioca; 4
Canal do Mangue; 5
Passeio Público; 5
Jardim Botânico do Rio de Janeiro; 7

The featured image shows the source code in Visual Studio Code.

6. Programming Languages