feat(mongo): improve completion and add distinct support

This commit is contained in:
Võ Văn Thành (Jay) authored and GitHub committed 2026-07-16 18:21:10 +08:00
1 parent 5bcad3adc6
commit 640e82cdc6
19 files changed
+1865 -275

No files matched your search

+1
View File
@@ -447,6 +447,7 @@ export const mongoFindOne = forward("mongoFindOne");
export const mongoCountDocuments = forward("mongoCountDocuments");
export const mongoServerVersion = forward("mongoServerVersion");
export const mongoAggregateDocuments = forward("mongoAggregateDocuments");
export const mongoDistinct = forward("mongoDistinct");
export const mongoCollectionStats = forward("mongoCollectionStats");
export const mongoCreateIndex = forward("mongoCreateIndex");
export const mongoDropIndexes = forward("mongoDropIndexes");
+4
View File
@@ -2131,6 +2131,10 @@ export async function mongoAggregateDocuments(connectionId: string, database: st
return post("/api/mongo/aggregate-documents", { connectionId, database, collection, pipelineJson, maxRows, executionId });
}
export async function mongoDistinct(connectionId: string, database: string, collection: string, field: string, filter?: string, executionId?: string): Promise<MongoDocumentResult> {
return post("/api/mongo/distinct", { connectionId, database, collection, field, filter, executionId });
}
export async function mongoCollectionStats(connectionId: string, database: string, collection: string, scale?: number, executionId?: string): Promise<MongoCollectionStatsResult> {
return post("/api/mongo/collection-stats", { connectionId, database, collection, scale, executionId });
}
+4
View File
@@ -1907,6 +1907,10 @@ export async function mongoAggregateDocuments(connectionId: string, database: st
return invoke("mongo_aggregate_documents", { connectionId, database, collection, pipelineJson, maxRows, executionId });
}
export async function mongoDistinct(connectionId: string, database: string, collection: string, field: string, filter?: string, executionId?: string): Promise<MongoDocumentResult> {
return invoke("mongo_distinct", { connectionId, database, collection, field, filter, executionId });
}
export async function mongoCollectionStats(connectionId: string, database: string, collection: string, scale?: number, executionId?: string): Promise<MongoCollectionStatsResult> {
return invoke("mongo_collection_stats", { connectionId, database, collection, scale, executionId });
}