From 4ab85dfd9da51c5496bffb2e82f1f1c9e73ba8c5 Mon Sep 17 00:00:00 2001 From: Stanislav Shupilkin Date: Wed, 11 Sep 2019 09:31:38 +0300 Subject: [PATCH 1/3] Update README --- README.md | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index a31c1330e..dea8ec5eb 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Laravel MongoDB =============== -[![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](http://img.shields.io/travis/jenssegers/laravel-mongodb.svg)](https://travis-ci.org/jenssegers/laravel-mongodb) [![Coverage Status](http://img.shields.io/coveralls/jenssegers/laravel-mongodb.svg)](https://coveralls.io/r/jenssegers/laravel-mongodb?branch=master) [![Donate](https://img.shields.io/badge/donate-paypal-blue.svg)](https://www.paypal.me/jenssegers) +[![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](http://img.shields.io/travis/jenssegers/laravel-mongodb.svg)](https://travis-ci.org/jenssegers/laravel-mongodb) [[![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) An Eloquent model and Query builder with support for MongoDB, using the original Laravel API. *This library extends the original Laravel classes, so it uses exactly the same methods.* @@ -45,6 +45,7 @@ composer require jenssegers/mongodb 5.6.x | 3.4.x 5.7.x | 3.4.x 5.8.x | 3.5.x + 6.0.x | 3.6.x And add the service provider in `config/app.php`: @@ -153,8 +154,8 @@ You can connect to multiple servers or replica sets with the following configura 'username' => env('DB_USERNAME'), 'password' => env('DB_PASSWORD'), 'options' => [ - 'replicaSet' => 'replicaSetName' - ] + 'replicaSet' => 'replicaSetName' + ] ], ``` @@ -263,7 +264,7 @@ Supported operations are: - unique - background, sparse, expire, geospatial (MongoDB specific) -All other (unsupported) operations are implemented as dummy pass-through methods, because MongoDB does not use a predefined schema. Read more about the schema builder on http://laravel.com/docs/schema +All other (unsupported) operations are implemented as dummy pass-through methods, because MongoDB does not use a predefined schema. Read more about the schema builder on https://laravel.com/docs/6.0/migrations#tables ### Geospatial indexes @@ -312,6 +313,7 @@ If you want to use MongoDB as your database backend, change the driver in `confi 'queue' => 'default', 'expire' => 60, ], +] ``` If you want to use MongoDB to handle failed jobs, change the database in `config/queue.php`: @@ -320,7 +322,7 @@ If you want to use MongoDB to handle failed jobs, change the database in `config 'failed' => [ 'database' => 'mongodb', 'table' => 'failed_jobs', - ], +], ``` And add the service provider in `config/app.php`: @@ -601,15 +603,15 @@ $users = User::where('location', 'geoWithin', [ [ -0.1450383, 51.5069158, - ], + ], [ -0.1367563, 51.5100913, - ], + ], [ -0.1270247, 51.5013233, - ], + ], [ -0.1450383, 51.5069158, @@ -693,7 +695,7 @@ For more information about model manipulation, check http://laravel.com/docs/elo ### Dates -Eloquent allows you to work with Carbon/DateTime objects instead of MongoDate objects. Internally, these dates will be converted to MongoDate objects when saved to the database. If you wish to use this functionality on non-default date fields, you will need to manually specify them as described here: http://laravel.com/docs/eloquent#date-mutators +Eloquent allows you to work with Carbon/DateTime objects instead of MongoDate objects. Internally, these dates will be converted to MongoDate objects when saved to the database. If you wish to use this functionality on non-default date fields, you will need to manually specify them as described here: https://laravel.com/docs/5.0/eloquent#date-mutators Example: @@ -770,7 +772,7 @@ class User extends Eloquent { ``` -Other relations are not yet supported, but may be added in the future. Read more about these relations on http://laravel.com/docs/eloquent#relationships +Other relations are not yet supported, but may be added in the future. Read more about these relations on https://laravel.com/docs/master/eloquent-relationships ### EmbedsMany Relations @@ -969,7 +971,7 @@ $cursor = DB::collection('users')->raw(function($collection) Optional: if you don't pass a closure to the raw method, the internal MongoCollection object will be accessible: ```php -$model = User::raw()->findOne(['age' => array('$lt' => 18)]); +$model = User::raw()->findOne(['age' => ['$lt' => 18]]); ``` The internal MongoClient and MongoDB objects can be accessed like this: @@ -1063,7 +1065,7 @@ You may easily cache the results of a query using the remember method: $users = User::remember(10)->get(); ``` -*From: http://laravel.com/docs/queries#caching-queries* +*From: https://laravel.com/docs/4.2/queries#caching-queries* ### Query Logging @@ -1073,4 +1075,4 @@ By default, Laravel keeps a log in memory of all queries that have been run for DB::connection()->disableQueryLog(); ``` -*From: http://laravel.com/docs/database#query-logging* +*From: https://laravel.com/docs/4.2/database#query-logging* From b96c3c3dd87c1000de03ac89b97f412bbf9352ca Mon Sep 17 00:00:00 2001 From: Stanislav Shupilkin Date: Wed, 11 Sep 2019 09:36:40 +0300 Subject: [PATCH 2/3] Delete useless links in markdown --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index dea8ec5eb..74a94cd83 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,6 @@ Table of contents * [Query Builder](#query-builder) * [Schema](#schema) * [Extensions](#extensions) -* [Troubleshooting](#troubleshooting) * [Examples](#examples) Installation From ffa5d14ab88266ec2723989e00cdda89c873d3eb Mon Sep 17 00:00:00 2001 From: Stanislav Shupilkin Date: Wed, 11 Sep 2019 09:41:45 +0300 Subject: [PATCH 3/3] Remove redundant symbol --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 74a94cd83..ced1cf2b7 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Laravel MongoDB =============== -[![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](http://img.shields.io/travis/jenssegers/laravel-mongodb.svg)](https://travis-ci.org/jenssegers/laravel-mongodb) [[![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) +[![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](http://img.shields.io/travis/jenssegers/laravel-mongodb.svg)](https://travis-ci.org/jenssegers/laravel-mongodb) [![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) An Eloquent model and Query builder with support for MongoDB, using the original Laravel API. *This library extends the original Laravel classes, so it uses exactly the same methods.*