Unverified Commit 815708d9 authored by Jens Segers's avatar Jens Segers Committed by GitHub

Merge pull request #1907 from Giacomo92/patch-1

 Added create index documentation
parents 39ef853d c1e02a92
...@@ -254,7 +254,18 @@ Schema::create('users', function($collection) ...@@ -254,7 +254,18 @@ Schema::create('users', function($collection)
$collection->unique('email'); $collection->unique('email');
}); });
``` ```
You can also pass all the parameters specified in the MongoDB docs [here](https://docs.mongodb.com/manual/reference/method/db.collection.createIndex/#options-for-all-index-types) in the `$options` parameter. For example:
```
Schema::create('users', function($collection)
{
$collection->index('username',null,null,[
'sparse' => true,
'unique' => true,
'background' => true
]);
});
```
Supported operations are: Supported operations are:
- create and drop - create and drop
......
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