@@ -65,10 +65,33 @@ Tell your model to use the MongoDB model and set the collection (alias for table
}
*You can also specify the connection name in the model by changing the `connection` property.*
If you are using a different database driver as the default one, you will need to specify the mongodb connection within your model by changing the `connection` property:
use Jenssegers\Mongodb\Model as Eloquent;
class MyModel extends Eloquent {
protected $connection = 'mongodb';
}
Everything else works just like the original Eloquent model. Read more about the Eloquent on http://laravel.com/docs/eloquent
### Optional: Alias
-------------------
You may also register an alias for the MongoDB model by adding the following to the alias array in `app/config/app.php`:
'Moloquent' => 'Jenssegers\Mongodb\Model',
This will allow you to use your registered alias like: