You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Laravel Eloquent add support for ODM (Object Document Mapper) to Laravel. It's the same as Eloquent ORM, but with Documents, since MongoDB is a NoSQL database.
6
+
Laravel Eloquent adds support for ODM (Object Document Mapper) to Laravel. It's the same as Eloquent ORM, but with Documents, since MongoDB is a NoSQL database.
7
7
8
8
Table of contents
9
9
-----------------
@@ -112,7 +112,7 @@ Upgrading
112
112
113
113
In this new major release which supports the new MongoDB PHP extension, we also moved the location of the Model class and replaced the MySQL model class with a trait.
114
114
115
-
Please change all `Jenssegers\Mongodb\Model` references to `Jenssegers\Mongodb\Eloquent\Model` either at the top of your model files, or your registered alias.
115
+
Please change all `Jenssegers\Mongodb\Model` references to `Jenssegers\Mongodb\Eloquent\Model` either at the top of your model files or your registered alias.
116
116
117
117
```php
118
118
use Jenssegers\Mongodb\Eloquent\Model;
@@ -156,7 +156,7 @@ docker-compose up
156
156
157
157
Configuration
158
158
-------------
159
-
You can use MongoDB either as a main database, either as a side database. To do so, add a new `mongodb` connection to `config/database.php`:
159
+
You can use MongoDB either as the main database, either as a side database. To do so, add a new `mongodb` connection to `config/database.php`:
160
160
161
161
```php
162
162
'mongodb' => [
@@ -175,7 +175,7 @@ You can use MongoDB either as a main database, either as a side database. To do
175
175
],
176
176
```
177
177
178
-
For multiple servers or replica set configurations, set the host to array and specify each server host:
178
+
For multiple servers or replica set configurations, set the host to an array and specify each server host:
179
179
180
180
```php
181
181
'mongodb' => [
@@ -188,7 +188,7 @@ For multiple servers or replica set configurations, set the host to array and sp
188
188
],
189
189
```
190
190
191
-
If you wish to use a connection string instead of a full key-value params, you can set it so. Check the documentation on MongoDB's URI format: https://docs.mongodb.com/manual/reference/connection-string/
191
+
If you wish to use a connection string instead of full key-value params, you can set it so. Check the documentation on MongoDB's URI format: https://docs.mongodb.com/manual/reference/connection-string/
192
192
193
193
```php
194
194
'mongodb' => [
@@ -226,7 +226,7 @@ class Book extends Model
226
226
}
227
227
```
228
228
229
-
**NOTE:**MongoDb documents are automatically stored with an unique ID that is stored in the `_id` property. If you wish to use your own ID, substitude the `$primaryKey` property and set it to your own primary key attribute name.
229
+
**NOTE:**MongoDB documents are automatically stored with a unique ID that is stored in the `_id` property. If you wish to use your own ID, substitute the `$primaryKey` property and set it to your own primary key attribute name.
The belongsToMany relation will not use a pivot "table", but will push id's to a __related_ids__ attribute instead. This makes the second parameter for the belongsToMany method useless.
770
+
The belongsToMany relation will not use a pivot "table" but will push id's to a __related_ids__ attribute instead. This makes the second parameter for the belongsToMany method useless.
771
771
772
772
If you want to define custom keys for your relation, set it to `null`:
773
773
@@ -787,7 +787,7 @@ class User extends Model
787
787
788
788
### EmbedsMany Relationship
789
789
790
-
If you want to embed models, rather than referencing them, you can use the `embedsMany` relation. This relation is similar to the `hasMany` relation, but embeds the models inside the parent object.
790
+
If you want to embed models, rather than referencing them, you can use the `embedsMany` relation. This relation is similar to the `hasMany` relation but embeds the models inside the parent object.
791
791
792
792
**REMEMBER**: These relations return Eloquent collections, they don't return query builder objects!
793
793
@@ -1000,7 +1000,7 @@ MongoDB specific operations:
1000
1000
- expire
1001
1001
- geospatial
1002
1002
1003
-
All other (unsupported) operations are implemented as dummy pass-through methods, because MongoDB does not use a predefined schema.
1003
+
All other (unsupported) operations are implemented as dummy pass-through methods because MongoDB does not use a predefined schema.
1004
1004
1005
1005
Read more about the schema builder on [Laravel Docs](https://laravel.com/docs/6.0/migrations#tables)
1006
1006
@@ -1033,11 +1033,11 @@ If you're using a hybrid MongoDB and SQL setup, you can define relationships acr
1033
1033
1034
1034
The model will automatically return a MongoDB-related or SQL-related relation based on the type of the related model.
1035
1035
1036
-
If you want this functionality to work both ways, your SQL-models will need use the `Jenssegers\Mongodb\Eloquent\HybridRelations` trait.
1036
+
If you want this functionality to work both ways, your SQL-models will need to use the `Jenssegers\Mongodb\Eloquent\HybridRelations` trait.
1037
1037
1038
1038
**This functionality only works for `hasOne`, `hasMany` and `belongsTo`.**
1039
1039
1040
-
The MySQL model shoul use the `HybridRelations` trait:
1040
+
The MySQL model should use the `HybridRelations` trait:
0 commit comments