Table of Contents
3. Setup
2. Changelog
« Previous
4. Basic Usage
Next »

3. Setup

AuthorDariusz Górecki

In your main configuration file, witch is by default: protected/config/main.php config file.

Add the following to the file:

'import' => array(
    // ...
    'ext.YiiMongoDbSuite.*',
),
 
'components' => array(
    // ...
    'mongodb' => array(
        'class'             => 'EMongoDB',
        'connectionString'  => 'mongodb://localhost',
        'dbName'            => 'myDatabaseName',
        'fsyncFlag'         => false,
        'safeFlag'          => false,
        'useCursor'         => false,
    ),
    // ...
),

That's all you have to do for setup. You can use it very much like the active record. Short example:

$client = new Client;
$client->first_name='something';
$client->save();
$clients = Client::model->findAll();
3. Setup
Table of Contents
« Previous
2. Changelog
Next »
4. Basic Usage