Unverified Commit 87880c03 authored by Jens Segers's avatar Jens Segers Committed by GitHub

Merge pull request #1827 from Smolevich/change-readme

Change readme
parents c0ca8abd ffa5d14a
Laravel MongoDB 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.* 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.*
...@@ -15,7 +15,6 @@ Table of contents ...@@ -15,7 +15,6 @@ Table of contents
* [Query Builder](#query-builder) * [Query Builder](#query-builder)
* [Schema](#schema) * [Schema](#schema)
* [Extensions](#extensions) * [Extensions](#extensions)
* [Troubleshooting](#troubleshooting)
* [Examples](#examples) * [Examples](#examples)
Installation Installation
...@@ -154,8 +153,8 @@ You can connect to multiple servers or replica sets with the following configura ...@@ -154,8 +153,8 @@ You can connect to multiple servers or replica sets with the following configura
'username' => env('DB_USERNAME'), 'username' => env('DB_USERNAME'),
'password' => env('DB_PASSWORD'), 'password' => env('DB_PASSWORD'),
'options' => [ 'options' => [
'replicaSet' => 'replicaSetName' 'replicaSet' => 'replicaSetName'
] ]
], ],
``` ```
...@@ -275,7 +274,7 @@ Supported operations are: ...@@ -275,7 +274,7 @@ Supported operations are:
- unique - unique
- background, sparse, expire, geospatial (MongoDB specific) - 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 ### Geospatial indexes
...@@ -324,6 +323,7 @@ If you want to use MongoDB as your database backend, change the driver in `confi ...@@ -324,6 +323,7 @@ If you want to use MongoDB as your database backend, change the driver in `confi
'queue' => 'default', 'queue' => 'default',
'expire' => 60, 'expire' => 60,
], ],
]
``` ```
If you want to use MongoDB to handle failed jobs, change the database in `config/queue.php`: If you want to use MongoDB to handle failed jobs, change the database in `config/queue.php`:
...@@ -332,7 +332,7 @@ If you want to use MongoDB to handle failed jobs, change the database in `config ...@@ -332,7 +332,7 @@ If you want to use MongoDB to handle failed jobs, change the database in `config
'failed' => [ 'failed' => [
'database' => 'mongodb', 'database' => 'mongodb',
'table' => 'failed_jobs', 'table' => 'failed_jobs',
], ],
``` ```
And add the service provider in `config/app.php`: And add the service provider in `config/app.php`:
...@@ -613,15 +613,15 @@ $users = User::where('location', 'geoWithin', [ ...@@ -613,15 +613,15 @@ $users = User::where('location', 'geoWithin', [
[ [
-0.1450383, -0.1450383,
51.5069158, 51.5069158,
], ],
[ [
-0.1367563, -0.1367563,
51.5100913, 51.5100913,
], ],
[ [
-0.1270247, -0.1270247,
51.5013233, 51.5013233,
], ],
[ [
-0.1450383, -0.1450383,
51.5069158, 51.5069158,
...@@ -705,7 +705,7 @@ For more information about model manipulation, check http://laravel.com/docs/elo ...@@ -705,7 +705,7 @@ For more information about model manipulation, check http://laravel.com/docs/elo
### Dates ### 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: Example:
...@@ -782,7 +782,7 @@ class User extends Eloquent { ...@@ -782,7 +782,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 ### EmbedsMany Relations
...@@ -981,7 +981,7 @@ $cursor = DB::collection('users')->raw(function($collection) ...@@ -981,7 +981,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: Optional: if you don't pass a closure to the raw method, the internal MongoCollection object will be accessible:
```php ```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: The internal MongoClient and MongoDB objects can be accessed like this:
...@@ -1075,7 +1075,7 @@ You may easily cache the results of a query using the remember method: ...@@ -1075,7 +1075,7 @@ You may easily cache the results of a query using the remember method:
$users = User::remember(10)->get(); $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 ### Query Logging
...@@ -1085,4 +1085,4 @@ By default, Laravel keeps a log in memory of all queries that have been run for ...@@ -1085,4 +1085,4 @@ By default, Laravel keeps a log in memory of all queries that have been run for
DB::connection()->disableQueryLog(); DB::connection()->disableQueryLog();
``` ```
*From: http://laravel.com/docs/database#query-logging* *From: https://laravel.com/docs/4.2/database#query-logging*
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