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

This commit is contained in:
2026-01-06 17:01:10 +08:00
parent a43da6e06e
commit 213ad95791
8 changed files with 123 additions and 91 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, findOptions...)
err = mongo.DB().Find(ctx, bsonFilter, &logs, consts.OperationLogCollection, nil, nil)
if err != nil {
return nil, 0, err
}