This commit is contained in:
wangchuxiao 2023-05-11 20:24:05 +08:00
parent d4cb40c390
commit 6b204c6066

View File

@ -137,7 +137,6 @@ func (m *MsgMongoDriver) UpdateOneDoc(ctx context.Context, msg *table.MsgDocMode
func (m *MsgMongoDriver) GetMsgBySeqIndexIn1Doc(ctx context.Context, docID string, beginSeq, endSeq int64) (msgs []*sdkws.MsgData, seqs []int64, err error) { func (m *MsgMongoDriver) GetMsgBySeqIndexIn1Doc(ctx context.Context, docID string, beginSeq, endSeq int64) (msgs []*sdkws.MsgData, seqs []int64, err error) {
beginIndex := m.msg.GetMsgIndex(beginSeq) beginIndex := m.msg.GetMsgIndex(beginSeq)
num := endSeq - beginSeq + 1 num := endSeq - beginSeq + 1
log.ZDebug(ctx, "info", "beginIndex", beginIndex, "num", num)
pipeline := bson.A{ pipeline := bson.A{
bson.M{ bson.M{
"$match": bson.M{"doc_id": docID}, "$match": bson.M{"doc_id": docID},
@ -154,7 +153,8 @@ func (m *MsgMongoDriver) GetMsgBySeqIndexIn1Doc(ctx context.Context, docID strin
if err != nil { if err != nil {
return nil, nil, errs.Wrap(err) return nil, nil, errs.Wrap(err)
} }
var msgInfos []table.MsgInfoModel log.ZDebug(ctx, "info", "beginIndex", beginIndex, "num", num)
var msgInfos []*table.MsgInfoModel
if err := cursor.All(ctx, &msgInfos); err != nil { if err := cursor.All(ctx, &msgInfos); err != nil {
return nil, nil, err return nil, nil, err
} }