refactor(msg): update regex pattern for conversationID to include a trailing colon

This commit is contained in:
withchao 2026-06-05 10:49:47 +08:00
parent 75ebca4ff8
commit 82f87551d6

View File

@ -956,7 +956,7 @@ func (m *MsgMgo) GetLastMessageSeqByTime(ctx context.Context, conversationID str
{
"$match": bson.M{
"doc_id": bson.M{
"$regex": fmt.Sprintf("^%s", conversationID),
"$regex": fmt.Sprintf("^%s:", conversationID),
},
},
},
@ -1008,7 +1008,7 @@ func (m *MsgMgo) GetLastMessage(ctx context.Context, conversationID string) (*mo
{
"$match": bson.M{
"doc_id": bson.M{
"$regex": fmt.Sprintf("^%s", conversationID),
"$regex": fmt.Sprintf("^%s:", conversationID),
},
},
},