fix(mongodb): use dedicated count for legacy collections

This commit is contained in:
Guoyu Su authored and GitHub committed 2026-07-13 13:21:50 +08:00
1 parent 03bc87c77a
commit a99a34b4ab
28 files changed
+916 -19

No files matched your search

+26
View File
@@ -110,6 +110,32 @@ pub async fn mongo_find_documents(
.await
}
#[tauri::command]
pub async fn mongo_count_documents(
state: State<'_, Arc<AppState>>,
connection_id: String,
database: String,
collection: String,
filter: Option<String>,
mode: Option<String>,
execution_id: Option<String>,
) -> Result<u64, String> {
let app = state.inner().clone();
crate::commands::document_cmd::run_cancellable(
&app,
execution_id,
dbx_core::mongo_ops::mongo_count_documents_core(
&app,
&connection_id,
&database,
&collection,
filter.as_deref(),
mode.as_deref(),
),
)
.await
}
#[tauri::command]
pub async fn mongo_server_version(
state: State<'_, Arc<AppState>>,