feat(mongo): add filter/sort support and fix table view editing

- Add filter and sort parameters to MongoDB find_documents across the
  full stack (driver, ops, tauri cmd, web routes, frontend API)
- Add find/sort input bar to MongoDocBrowser table view via DataGrid
  search-bar slot, matching WHERE/ORDER BY positioning
- Fix table view editing: allow cell editing when customSave is provided
  (bypasses primary key requirement for MongoDB)
- Fix replace_one WriteError 66 by removing _id from replacement doc
- Align action buttons (refresh, add row, commit) to the right in grid
This commit is contained in:
t8y2
2026-05-14 14:43:26 +08:00
parent 12fec968fe
commit 88ad579a27
10 changed files with 121 additions and 13 deletions
+4
View File
@@ -28,6 +28,8 @@ pub struct MongoFindRequest {
pub collection: String,
pub skip: Option<u64>,
pub limit: Option<i64>,
pub filter: Option<String>,
pub sort: Option<String>,
}
#[derive(Deserialize)]
@@ -88,6 +90,8 @@ pub async fn find_documents(
&req.collection,
req.skip.unwrap_or(0),
req.limit.unwrap_or(50),
req.filter.as_deref(),
req.sort.as_deref(),
)
.await
.map_err(AppError)?;