Commit 3176d180 authored by Jagdeep Singh's avatar Jagdeep Singh

update readme

added table of contents and projections with paginate example
parent 850bc18e
...@@ -17,6 +17,18 @@ $this->embedsMany('Book', '_books'); ...@@ -17,6 +17,18 @@ $this->embedsMany('Book', '_books');
Read the full changelog at https://github.com/jenssegers/laravel-mongodb/releases/tag/v2.0.0 Read the full changelog at https://github.com/jenssegers/laravel-mongodb/releases/tag/v2.0.0
Table of contents
-----------------
* [Installation](#installation)
* [Configuration](#configuration)
* [Eloquent](#eloquent)
* [Optional: Alias](#optional-alias)
* [Query Builder](#query-builder)
* [Schema](#schema)
* [Extensions](#extensions)
* [Troubleshooting](#troubleshooting)
* [Examples](#examples)
Installation Installation
------------ ------------
...@@ -822,6 +834,17 @@ You can apply projections to your queries using the `project` method. ...@@ -822,6 +834,17 @@ You can apply projections to your queries using the `project` method.
DB::collection('items')->project(array('tags' => array('$slice' => 1)))->get(); DB::collection('items')->project(array('tags' => array('$slice' => 1)))->get();
``` ```
**Projections with Pagination**
You can apply projections to your queries using the `project` method.
```php
$limit = 25;
$projections = array('id', 'name');
DB::collection('items')->paginate($limit, $projections);
```
**Push** **Push**
Add an items to an array. Add an items to an array.
......
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