优化mongo,封装count逻辑,处理objectId

This commit is contained in:
2026-01-07 16:19:28 +08:00
parent 40c5d5de79
commit a1f9e627e4
3 changed files with 47 additions and 52 deletions

View File

@@ -86,7 +86,7 @@ func (d *log) List(ctx context.Context, filter *dto.ListLogsReq, sortFields ...s
}
var logs []*entity.OperationLog
err = mongo.DB().Find(ctx, bsonFilter, &logs, consts.OperationLogCollection, nil, nil)
_, err = mongo.DB().Find(ctx, bsonFilter, &logs, consts.OperationLogCollection, nil, nil)
if err != nil {
return nil, 0, err
}