创建索引
This commit is contained in:
parent
baa0517b64
commit
9077626a90
@ -16,6 +16,8 @@ import (
|
|||||||
|
|
||||||
"github.com/go-redis/redis/v8"
|
"github.com/go-redis/redis/v8"
|
||||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||||
|
"go.mongodb.org/mongo-driver/mongo"
|
||||||
|
"go.mongodb.org/mongo-driver/x/bsonx"
|
||||||
)
|
)
|
||||||
|
|
||||||
var floorRankKey = "pagoda:floor"
|
var floorRankKey = "pagoda:floor"
|
||||||
@ -29,6 +31,11 @@ func (this *ModelRank) Init(service core.IService, module core.IModule, comp cor
|
|||||||
this.TableName = comm.TablePagodaRecord
|
this.TableName = comm.TablePagodaRecord
|
||||||
err = this.MCompModel.Init(service, module, comp, options)
|
err = this.MCompModel.Init(service, module, comp, options)
|
||||||
this.modulePagoda = module.(*Pagoda)
|
this.modulePagoda = module.(*Pagoda)
|
||||||
|
|
||||||
|
//创建uid索引
|
||||||
|
this.DB.CreateIndex(core.SqlTable(comm.TableMail), mongo.IndexModel{
|
||||||
|
Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}},
|
||||||
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user