上传索引错误返回
This commit is contained in:
parent
bb449d6cb9
commit
cd0c174fff
@ -34,7 +34,7 @@ func (this *modelArena) Init(service core.IService, module core.IModule, comp co
|
|||||||
this.MCompModel.Init(service, module, comp, opt)
|
this.MCompModel.Init(service, module, comp, opt)
|
||||||
this.module = module.(*Arena)
|
this.module = module.(*Arena)
|
||||||
//创建uid索引
|
//创建uid索引
|
||||||
this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
|
_, err = this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
|
||||||
Keys: bson.A{
|
Keys: bson.A{
|
||||||
bsonx.Doc{
|
bsonx.Doc{
|
||||||
{Key: "uid", Value: bsonx.Int32(1)},
|
{Key: "uid", Value: bsonx.Int32(1)},
|
||||||
|
@ -21,7 +21,7 @@ func (this *modelRecord) Init(service core.IService, module core.IModule, comp c
|
|||||||
this.MCompModel.Init(service, module, comp, opt)
|
this.MCompModel.Init(service, module, comp, opt)
|
||||||
this.module = module.(*Arena)
|
this.module = module.(*Arena)
|
||||||
//创建uid索引
|
//创建uid索引
|
||||||
this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
|
_, err = this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
|
||||||
Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}},
|
Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}},
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
|
@ -12,8 +12,6 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"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"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
///数据组件
|
///数据组件
|
||||||
@ -28,9 +26,9 @@ func (this *modelBattleComp) Init(service core.IService, module core.IModule, co
|
|||||||
this.MCompModel.Init(service, module, comp, opt)
|
this.MCompModel.Init(service, module, comp, opt)
|
||||||
this.module = module.(*Battle)
|
this.module = module.(*Battle)
|
||||||
this.TableName = "battle"
|
this.TableName = "battle"
|
||||||
this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
|
// _, err = this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
|
||||||
Keys: bsonx.Doc{{Key: "heroid", Value: bsonx.Int32(1)}},
|
// Keys: bsonx.Doc{{Key: "heroid", Value: bsonx.Int32(1)}},
|
||||||
})
|
// })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ func (this *modelChatComp) Init(service core.IService, module core.IModule, comp
|
|||||||
this.MCompModel.Init(service, module, comp, opt)
|
this.MCompModel.Init(service, module, comp, opt)
|
||||||
this.module = module.(*Chat)
|
this.module = module.(*Chat)
|
||||||
//创建uid索引
|
//创建uid索引
|
||||||
this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
|
_, err = this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
|
||||||
Keys: bsonx.Doc{{Key: "ruid", Value: bsonx.Int32(1)}},
|
Keys: bsonx.Doc{{Key: "ruid", Value: bsonx.Int32(1)}},
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
|
@ -27,7 +27,7 @@ func (this *modelEquipmentComp) Init(service core.IService, module core.IModule,
|
|||||||
this.MCompModel.Init(service, module, comp, opt)
|
this.MCompModel.Init(service, module, comp, opt)
|
||||||
this.module = module.(*Equipment)
|
this.module = module.(*Equipment)
|
||||||
//创建uid索引
|
//创建uid索引
|
||||||
this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
|
_, err = this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
|
||||||
Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}},
|
Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}},
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
|
@ -28,7 +28,7 @@ func (this *modelForumComp) Init(service core.IService, module core.IModule, com
|
|||||||
this.module = module.(*Forum)
|
this.module = module.(*Forum)
|
||||||
|
|
||||||
//创建uid索引
|
//创建uid索引
|
||||||
this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
|
_, err = this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
|
||||||
Keys: bsonx.Doc{{Key: "heroid", Value: bsonx.Int32(1)}},
|
Keys: bsonx.Doc{{Key: "heroid", Value: bsonx.Int32(1)}},
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user