MongoDB Secured Connection

<?php
date_default_timezone_set("Asia/Dhaka");
$host = '192.168.0.1';
$pass = 'databasePassword';
$user = 'databaseUsername';
$dbName = 'databaseName';
$nameOfCollection = 'collectionName';
$connection = new MongoClient("mongodb://${user}:${pass}@$host", array("db" => $dbName));
$db = $connection->selectDB($dbName);
$COLL_collection = new MongoCollection($db, $nameOfCollection);

Comments

Popular posts from this blog

WP register_post_type() with custom CMB2 meta box

Git post receive setup at server for git push to the production from local machine