feat: Redis/MongoDB分页+CSV导出全数据库类型支持

后端:
- Redis 分页: KEYS→SCAN分页, LRANGE→offset/limit, SMEMBERS→SSCAN分页
- MongoDB 新增 executeMongoQuery: db.collection.find/aggregate 解析
  - find: skip/limit分页 + CountDocuments总数
  - aggregate: $facet并行取count+data
  - bson.M扁平化处理嵌套文档
- ExportQueryCSV 改为多分支: exportSQLCSV/exportRedisCSV/exportMongoCSV
  - Redis: 复用executeRedisQuery取数据写CSV
  - MongoDB: 复用executeMongoQuery取数据写CSV
- 新增 mongo-driver v2 依赖
- 前端: Redis也显示导出CSV按钮(去掉dbType过滤)
This commit is contained in:
logan committed 2026-05-28 15:58:42 +08:00
1 parent 5ea86fe334
commit 3b3cc32d45
3 files changed
+420 -34

No files matched your search

+1 -1
View File
@@ -494,7 +494,7 @@ export default function QueriesPage() {
<span>{result.columns?.length || 0} 列</span>
</>
)}
{result.rows?.length > 0 && dbType !== 'redis' && (
{result.rows?.length > 0 && (
<button onClick={handleExportResult}
className="dg-btn dg-btn-ghost dg-btn-sm">
<Download className="w-3 h-3" />导出 CSV