Skip to content

Commit 4e92940

Browse files
authored
Update Readme.md
Signed-off-by: Amit Jangid <amitjangid80@yahoo.in>
1 parent 5d84ee1 commit 4e92940

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

Readme.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func CreateIndex() {
6666

6767
```go
6868
func CreateIndex() {
69-
// For Single Field
69+
// For Multiple Fields
7070
indexModel := mongo.IndexModel{
7171
Options: options.Index().SetUnique(true),
7272
Keys: bson.D{
@@ -75,12 +75,6 @@ func CreateIndex() {
7575
},
7676
}
7777

78-
// For Multiple Fields
79-
indexModel := mongo.IndexModel{
80-
Keys: bson.M{"YOUR_FIELD_NAME": 1, "ANOTHER_FIELD_NAME": 1},
81-
Options: options.Index().SetUnique(true),
82-
}
83-
8478
mongodb_client.CreateIndex("YOUR_DB_NAME", "YOUR_COLLECTION_NAME", indexModel)
8579
}
8680
```

0 commit comments

Comments
 (0)