From bb667238f2090e16e10028aaf93b5f5d59923260 Mon Sep 17 00:00:00 2001 From: withchao <993506633@qq.com> Date: Tue, 4 Jul 2023 16:55:34 +0800 Subject: [PATCH] active user --- pkg/common/db/unrelation/msg.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/common/db/unrelation/msg.go b/pkg/common/db/unrelation/msg.go index 7fff3169c..663e792af 100644 --- a/pkg/common/db/unrelation/msg.go +++ b/pkg/common/db/unrelation/msg.go @@ -554,7 +554,7 @@ func (m *MsgMongoDriver) RangeUserSendCount(ctx context.Context, start time.Time }, bson.M{ "$project": bson.M{ - "msgs": bson.M{ + "result": bson.M{ "$map": bson.M{ "input": "$msgs", "as": "item", @@ -691,7 +691,7 @@ func (m *MsgMongoDriver) RangeUserSendCount(ctx context.Context, start time.Time }, }, } - cur, err := m.MsgCollection.Aggregate(ctx, pipeline) + cur, err := m.MsgCollection.Aggregate(ctx, pipeline, options.Aggregate().SetAllowDiskUse(true)) if err != nil { return 0, 0, nil, nil, errs.Wrap(err) }