uid 当做索引

This commit is contained in:
meixiongfeng 2022-06-21 14:00:20 +08:00
parent f54b2985ac
commit fad5a938a5

View File

@ -5,6 +5,9 @@ import (
"go_dreamfactory/modules"
"go_dreamfactory/lego/core"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/x/bsonx"
)
const (
@ -26,6 +29,11 @@ func (this *Api_Comp) Init(service core.IService, module core.IModule, comp core
this.MComp_GateComp.Init(service, module, comp, options)
this.service = service
this.module = module.(*Mail)
//创建uid索引
this.module.db_comp.DB.CreateIndex(core.SqlTable(DB_MailTable), mongo.IndexModel{
Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}},
})
return
}