From 1923d0b80955785ab987bab0f9e4c9fcaa08d6e8 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Fri, 6 May 2022 17:05:59 +0800 Subject: [PATCH] office --- pkg/common/db/model.go | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/pkg/common/db/model.go b/pkg/common/db/model.go index 364395639..658220f78 100644 --- a/pkg/common/db/model.go +++ b/pkg/common/db/model.go @@ -3,8 +3,6 @@ package db import ( "Open_IM/pkg/common/config" "go.mongodb.org/mongo-driver/bson" - "go.mongodb.org/mongo-driver/x/bsonx" - //"Open_IM/pkg/common/log" "Open_IM/pkg/utils" "fmt" @@ -74,15 +72,7 @@ func init() { cSendLogModels := []mongo.IndexModel{ { - Keys: bsonx.Doc{ - { - Key: "send_id", - }, - { - Key: "send_time", - Value: bsonx.Int32(-1), - }, - }, + Keys: bson.M{"send_id": -1, "send_time": -1}, }, } result, err := dataBase.Collection(cSendLog).Indexes().CreateMany(context.Background(), cSendLogModels, opts)