June 2017
Intermediate to advanced
536 pages
9h 49m
English
Using the mongodb driver extension and the mongodb/mongodb PHP library, we can connect to the Mongo database from PHP using the MongoDBDriverManager class, as follows:
<?phprequire_once __DIR__ . '/vendor/autoload.php';$manager = new MongoDBDriverManager('mongodb://localhost:27017');
This single-line expression will look for MongoDB on localhost under port 27017.