PHP code example of orbital-framework / mongodb

1. Go to this page and download the library: Download orbital-framework/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/ */

    

orbital-framework / mongodb example snippets


use \Orbital\Framework\App;
use \Orbital\Env\Env;

App::set('mongodb', array(
    'client' => array(
        'uri' => Env::get('MONGODB_URI'),
        'options' => array(),
        'driver' => array()
    ),
    'database' => array(
        'name' => Env::get('MONGODB_DATABASE'),
        'options' => array()
    )
));

array(
    # ...
    'MONGODB_URI' => 'mongodb://user:password@localhost:27017',
    'MONGODB_DATABASE' => 'my-database',
    # ...
);