加索引
This commit is contained in:
parent
a0e7048039
commit
f13707e51b
@ -10,6 +10,7 @@ import (
|
||||
|
||||
"go.mongodb.org/mongo-driver/bson"
|
||||
"go.mongodb.org/mongo-driver/mongo"
|
||||
"go.mongodb.org/mongo-driver/x/bsonx"
|
||||
)
|
||||
|
||||
type ModelFriend struct {
|
||||
@ -21,6 +22,10 @@ func (this *ModelFriend) Init(service core.IService, module core.IModule, comp c
|
||||
this.TableName = comm.TableFriend
|
||||
err = this.MCompModel.Init(service, module, comp, options)
|
||||
this.moduleFriend = module.(*Friend)
|
||||
this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
|
||||
Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}},
|
||||
})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,7 @@ import (
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"go.mongodb.org/mongo-driver/mongo"
|
||||
"go.mongodb.org/mongo-driver/x/bsonx"
|
||||
)
|
||||
|
||||
type ModelRtaskRecord struct {
|
||||
@ -22,6 +23,10 @@ func (this *ModelRtaskRecord) Init(service core.IService, module core.IModule, c
|
||||
err = this.MCompModel.Init(service, module, comp, options)
|
||||
this.moduleRtask = module.(*ModuleRtask)
|
||||
this.service = service
|
||||
this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
|
||||
Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}},
|
||||
})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -49,6 +49,9 @@ func (this *ModelSociaty) Init(service core.IService, module core.IModule, comp
|
||||
this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
|
||||
Keys: bsonx.Doc{{Key: "_id", Value: bsonx.Int32(1)}},
|
||||
})
|
||||
this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
|
||||
Keys: bsonx.Doc{{Key: "name", Value: bsonx.Int32(1)}},
|
||||
})
|
||||
this.module = module.(*Sociaty)
|
||||
this.service = service
|
||||
this.EventApp = event_v2.NewApp()
|
||||
|
Loading…
Reference in New Issue
Block a user