PHP code example of dedemao / mongodb

1. Go to this page and download the library: Download dedemao/mongodb library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

dedemao / mongodb example snippets




$conf['host'] = '127.0.0.1';
$conf['port'] = '27017';
$conf['user'] = '';
$conf['pass'] = '';
$conf['dbname'] = 'test';
$conf['collectionname'] = 'demo';
$mongo = new dedemao\mongodb\MongoDBHelper($conf);



$conf['host'] = '127.0.0.1';
$conf['port'] = '27017';
$conf['user'] = '';
$conf['pass'] = '';
$conf['dbname'] = 'test';
$conf['collectionname'] = 'demo';
$mongo = new dedemao\mongodb\MongoDBHelper($conf);