From 0b74edb04fc07c333cbaf3b6b48a181392e193a8 Mon Sep 17 00:00:00 2001
From: Giacomo Fabbian <giacomo.fabbian@studenti.unipd.it>
Date: Thu, 16 Jan 2020 09:51:13 +0100
Subject: [PATCH] Added create index documentation
---
README.md | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/README.md b/README.md
index a6fc96e..3487a67 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
--
2.18.1