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
Post a Comment