Commit dcee382e by Klimov Paul

Mongo README.md updated.

parent f77e3b4b
...@@ -65,11 +65,13 @@ class Customer extends ActiveRecord ...@@ -65,11 +65,13 @@ class Customer extends ActiveRecord
*/ */
public function attributes() public function attributes()
{ {
return ['name', 'email', 'address', 'status']; return ['_id', 'name', 'email', 'address', 'status'];
} }
} }
``` ```
Note: collection primary key name ('_id') should be always explicitly setup as an attribute.
You can use [[\yii\data\ActiveDataProvider]] with [[\yii\mongodb\Query]] and [[\yii\mongodb\ActiveQuery]]: You can use [[\yii\data\ActiveDataProvider]] with [[\yii\mongodb\Query]] and [[\yii\mongodb\ActiveQuery]]:
```php ```php
...@@ -102,3 +104,8 @@ $models = $provider->getModels(); ...@@ -102,3 +104,8 @@ $models = $provider->getModels();
This extension supports [MongoGridFS](http://docs.mongodb.org/manual/core/gridfs/) via This extension supports [MongoGridFS](http://docs.mongodb.org/manual/core/gridfs/) via
classes under namespace "\yii\mongodb\file". classes under namespace "\yii\mongodb\file".
This extension supports logging and profiling, however log messages does not contain
actual text of the performed queries, they contains only a “close approximation” of it
composed on the values which can be extracted from PHP Mongo extension classes.
If you need to see actual query text, you should use specific tools for that.
\ No newline at end of file
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