|
|
@ -3,8 +3,6 @@ package db
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"Open_IM/pkg/common/config"
|
|
|
|
"Open_IM/pkg/common/config"
|
|
|
|
"go.mongodb.org/mongo-driver/bson"
|
|
|
|
"go.mongodb.org/mongo-driver/bson"
|
|
|
|
"go.mongodb.org/mongo-driver/x/bsonx"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//"Open_IM/pkg/common/log"
|
|
|
|
//"Open_IM/pkg/common/log"
|
|
|
|
"Open_IM/pkg/utils"
|
|
|
|
"Open_IM/pkg/utils"
|
|
|
|
"fmt"
|
|
|
|
"fmt"
|
|
|
@ -74,15 +72,7 @@ func init() {
|
|
|
|
|
|
|
|
|
|
|
|
cSendLogModels := []mongo.IndexModel{
|
|
|
|
cSendLogModels := []mongo.IndexModel{
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Keys: bsonx.Doc{
|
|
|
|
Keys: bson.M{"send_id": -1, "send_time": -1},
|
|
|
|
{
|
|
|
|
|
|
|
|
Key: "send_id",
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Key: "send_time",
|
|
|
|
|
|
|
|
Value: bsonx.Int32(-1),
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
result, err := dataBase.Collection(cSendLog).Indexes().CreateMany(context.Background(), cSendLogModels, opts)
|
|
|
|
result, err := dataBase.Collection(cSendLog).Indexes().CreateMany(context.Background(), cSendLogModels, opts)
|
|
|
|