This commit is contained in:
wangchuxiao
2023-05-29 16:26:24 +08:00
parent b4844a8a88
commit 02b4c012ad
2 changed files with 6 additions and 1 deletions
+1 -1
View File
@@ -99,7 +99,7 @@ func (m *Mongo) createMongoIndex(collection string, isUnique bool, keys ...strin
index := mongo.IndexModel{
Keys: keysDoc,
}
if isUnique == true {
if isUnique {
index.Options = options.Index().SetUnique(true)
}
result, err := indexView.CreateOne(