diff --git a/README.md b/README.md index a6fc96e39cdfa2d57e34f8ced8be54e8429be848..3487a675c29243abeae3981cd1ddf2adb99479c8 100644 --- a/README.md +++ b/README.md @@ -254,7 +254,18 @@ Schema::create('users', function($collection) $collection->unique('email'); }); ``` +You can also pass all the parameter 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: - create and drop