Skip to content

Commit 93a9048

Browse files
committed
Merge branch 'refactor/readme' of github.com:rennokki/laravel-mongodb into refactor/readme
2 parents df2a4ef + 7e91b7a commit 93a9048

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Laravel MongoDB
33

44
[![Latest Stable Version](http://img.shields.io/github/release/jenssegers/laravel-mongodb.svg)](https://packagist.org/packages/jenssegers/mongodb) [![Total Downloads](http://img.shields.io/packagist/dm/jenssegers/mongodb.svg)](https://packagist.org/packages/jenssegers/mongodb) [![Build Status](https://img.shields.io/github/workflow/status/jenssegers/laravel-mongodb/CI)](https://github.com/jenssegers/laravel-mongodb/actions) [![Coverage Status](https://coveralls.io/repos/github/jenssegers/laravel-mongodb/badge.svg?branch=master)](https://coveralls.io/github/jenssegers/laravel-mongodb?branch=master) [![Donate](https://img.shields.io/badge/donate-paypal-blue.svg)](https://www.paypal.me/jenssegers)
55

6-
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.
77

88
Table of contents
99
-----------------
@@ -110,7 +110,7 @@ Upgrading
110110

111111
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.
112112

113-
Please change all `Jenssegers\Mongodb\Model` references to `Jenssegers\Mongodb\Eloquent\Model` either at the top of your model files, or your registered alias.
113+
Please change all `Jenssegers\Mongodb\Model` references to `Jenssegers\Mongodb\Eloquent\Model` either at the top of your model files or your registered alias.
114114

115115
```php
116116
use Jenssegers\Mongodb\Eloquent\Model;
@@ -154,7 +154,7 @@ docker-compose up
154154

155155
Configuration
156156
-------------
157-
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`:
157+
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`:
158158

159159
```php
160160
'mongodb' => [
@@ -173,7 +173,7 @@ You can use MongoDB either as a main database, either as a side database. To do
173173
],
174174
```
175175

176-
For multiple servers or replica set configurations, set the host to array and specify each server host:
176+
For multiple servers or replica set configurations, set the host to an array and specify each server host:
177177

178178
```php
179179
'mongodb' => [
@@ -186,7 +186,7 @@ For multiple servers or replica set configurations, set the host to array and sp
186186
],
187187
```
188188

189-
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/
189+
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/
190190

191191
```php
192192
'mongodb' => [
@@ -224,7 +224,7 @@ class Book extends Model
224224
}
225225
```
226226

227-
**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.
227+
**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.
228228

229229
```php
230230
use Jenssegers\Mongodb\Eloquent\Model;
@@ -337,7 +337,7 @@ $users =
337337
$users = User::whereIn('age', [16, 18, 20])->get();
338338
```
339339

340-
When using `whereNotIn` objects will be returned if the field is non existent. Combine with `whereNotNull('age')` to leave out those documents.
340+
When using `whereNotIn` objects will be returned if the field is non-existent. Combine with `whereNotNull('age')` to leave out those documents.
341341

342342
**whereBetween**
343343

@@ -536,10 +536,10 @@ User::where('age', 'mod', [10, 0])->get();
536536

537537
```php
538538
$bars = Bar::where('location', 'near', [
539-
'$geometry' => [
539+
'$geometry' => [
540540
'type' => 'Point',
541-
'coordinates' => [
542-
-0.1367563, // longitude
541+
'coordinates' => [
542+
-0.1367563, // longitude
543543
51.5100913, // latitude
544544
],
545545
],
@@ -551,9 +551,9 @@ $bars = Bar::where('location', 'near', [
551551

552552
```php
553553
$bars = Bar::where('location', 'geoWithin', [
554-
'$geometry' => [
554+
'$geometry' => [
555555
'type' => 'Polygon',
556-
'coordinates' => [
556+
'coordinates' => [
557557
[
558558
[-0.1450383, 51.5069158],
559559
[-0.1367563, 51.5100913],
@@ -765,7 +765,7 @@ class Item extends Model
765765

766766
### belongsToMany and pivots
767767

768-
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.
768+
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.
769769

770770
If you want to define custom keys for your relation, set it to `null`:
771771

@@ -785,7 +785,7 @@ class User extends Model
785785

786786
### EmbedsMany Relationship
787787

788-
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.
788+
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.
789789

790790
**REMEMBER**: These relations return Eloquent collections, they don't return query builder objects!
791791

@@ -998,7 +998,7 @@ MongoDB specific operations:
998998
- expire
999999
- geospatial
10001000

1001-
All other (unsupported) operations are implemented as dummy pass-through methods, because MongoDB does not use a predefined schema.
1001+
All other (unsupported) operations are implemented as dummy pass-through methods because MongoDB does not use a predefined schema.
10021002

10031003
Read more about the schema builder on [Laravel Docs](https://laravel.com/docs/6.0/migrations#tables)
10041004

@@ -1031,11 +1031,11 @@ If you're using a hybrid MongoDB and SQL setup, you can define relationships acr
10311031

10321032
The model will automatically return a MongoDB-related or SQL-related relation based on the type of the related model.
10331033

1034-
If you want this functionality to work both ways, your SQL-models will need use the `Jenssegers\Mongodb\Eloquent\HybridRelations` trait.
1034+
If you want this functionality to work both ways, your SQL-models will need to use the `Jenssegers\Mongodb\Eloquent\HybridRelations` trait.
10351035

10361036
**This functionality only works for `hasOne`, `hasMany` and `belongsTo`.**
10371037

1038-
The MySQL model shoul use the `HybridRelations` trait:
1038+
The MySQL model should use the `HybridRelations` trait:
10391039

10401040
```php
10411041
use Jenssegers\Mongodb\Eloquent\HybridRelations;

0 commit comments

Comments
 (0)