feat(mongodb): improve sidebar index management

This commit is contained in:
onenewcode authored and GitHub committed 2026-08-02 22:45:33 +08:00
1 parent 22055e081f
commit 8e7b74d0ee
56 files changed
+3558 -246

No files matched your search

+2 -1
View File
@@ -99,6 +99,7 @@ import type {
DocumentQueryResult,
MongoDocumentResult,
MongoCollectionStatsResult,
MongoDropIndexesResult,
MongoGridFsBucketInfo,
HistoryEntry,
HistorySearchRequest,
@@ -3105,7 +3106,7 @@ export async function mongoCreateIndex(connectionId: string, database: string, c
});
}
export async function mongoDropIndexes(connectionId: string, database: string, collection: string, indexesJson?: string, single = false): Promise<{ dropped_names: string[]; affected_rows: number }> {
export async function mongoDropIndexes(connectionId: string, database: string, collection: string, indexesJson?: string, single = false): Promise<MongoDropIndexesResult> {
return post("/api/mongo/drop-indexes", {
connectionId,
database,
+12 -1
View File
@@ -2796,6 +2796,17 @@ export interface MongoCollectionStatsResult {
nindexes: unknown;
}
export interface MongoDropIndexFailure {
name: string;
message: string;
}
export interface MongoDropIndexesResult {
dropped_names: string[];
affected_rows: number;
failures?: MongoDropIndexFailure[];
}
export interface MongoGridFsFileInfo {
id: string;
filename?: string;
@@ -3043,7 +3054,7 @@ export async function mongoCreateIndex(connectionId: string, database: string, c
});
}
export async function mongoDropIndexes(connectionId: string, database: string, collection: string, indexesJson?: string, single = false): Promise<{ dropped_names: string[]; affected_rows: number }> {
export async function mongoDropIndexes(connectionId: string, database: string, collection: string, indexesJson?: string, single = false): Promise<MongoDropIndexesResult> {
return invoke("mongo_drop_indexes", {
connectionId,
database,