PHP code example of df / silex-doctrine-mongodb-provider
1. Go to this page and download the library: Download df/silex-doctrine-mongodb-provider 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/ */
df / silex-doctrine-mongodb-provider example snippets
{.php}
$document = ['key' => 'value'];
$app['mongodb']
->selectDatabase('mongo_db_01')
->selectCollection('sample')
->insert($document)
;
{.php}
$document = ['key' => 'value'];
$app['mongodbs']['mongo1']
->selectDatabase('mongo_db_01')
->selectCollection('sample')
->insert($document)
;