We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5d84ee1 commit 4e92940Copy full SHA for 4e92940
Readme.md
@@ -66,7 +66,7 @@ func CreateIndex() {
66
67
```go
68
func CreateIndex() {
69
- // For Single Field
+ // For Multiple Fields
70
indexModel := mongo.IndexModel{
71
Options: options.Index().SetUnique(true),
72
Keys: bson.D{
@@ -75,12 +75,6 @@ func CreateIndex() {
75
},
76
}
77
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
-
84
mongodb_client.CreateIndex("YOUR_DB_NAME", "YOUR_COLLECTION_NAME", indexModel)
85
86
```
0 commit comments