done check log
This commit is contained in:
parent
a095bb9f08
commit
110127e76a
3
index.go
3
index.go
|
@ -13,7 +13,6 @@ import (
|
|||
|
||||
// CreateIndex ...
|
||||
func CreateIndex(colName string, ind mongo.IndexModel) {
|
||||
fmt.Println("db name:", db.Name())
|
||||
// Get collection
|
||||
col := db.Collection(colName)
|
||||
if col == nil {
|
||||
|
@ -21,8 +20,6 @@ func CreateIndex(colName string, ind mongo.IndexModel) {
|
|||
return
|
||||
}
|
||||
|
||||
fmt.Println("ind", ind)
|
||||
|
||||
opts := options.CreateIndexes().SetMaxTime(time.Minute * 10)
|
||||
_, err := col.Indexes().CreateOne(context.Background(), ind, opts)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue