From dd99f52355375e5733db6d6d534e5a31ffbac5d2 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Thu, 11 May 2023 20:35:59 +0800 Subject: [PATCH] msg --- pkg/common/db/unrelation/msg.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/common/db/unrelation/msg.go b/pkg/common/db/unrelation/msg.go index 1b97e24a4..344fd26a8 100644 --- a/pkg/common/db/unrelation/msg.go +++ b/pkg/common/db/unrelation/msg.go @@ -144,7 +144,8 @@ func (m *MsgMongoDriver) GetMsgBySeqIndexIn1Doc(ctx context.Context, docID strin bson.M{ "$project": bson.M{ "msgs": bson.M{ - "$slice": []interface{}{"$msgs", beginIndex, num}, + // "$slice": []interface{}{"$msgs", beginIndex, num}, + "$slice": bson.A{"$msgs", beginIndex, num}, }, }, }, @@ -155,7 +156,7 @@ func (m *MsgMongoDriver) GetMsgBySeqIndexIn1Doc(ctx context.Context, docID strin } log.ZDebug(ctx, "info", "beginIndex", beginIndex, "num", num) var msgInfos []*table.MsgInfoModel - if err := cursor.Decode(&msgInfos); err != nil { + if err := cursor.All(ctx, &msgInfos); err != nil { return nil, nil, err } if len(msgInfos) < 1 {