Commit c700adee authored by wikichua's avatar wikichua

Update README.md

Request to add alternative set up for Mongo Eloquent
parent f2cc0501
......@@ -69,6 +69,26 @@ Tell your model to use the MongoDB model and set the collection (alias for table
Everything else works just like the original Eloquent model. Read more about the Eloquent on http://laravel.com/docs/eloquent
Alternative Eloquent Setting
----------------------------
'aliases' => array(...
'Moloquent' => 'Jenssegers\Mongodb\Model',
);
class MyModel extends Moloquent {
protected $collection = 'mycollection';
}
Add
protected $connection = 'mongodb';
in the MyModel if you have multiple database connections and do not want to overwrite the primary database connection.
Query Builder
-------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment