mirror of
https://github.com/t8y2/dbx.git
synced 2026-10-30 16:21:39 +00:00
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:
@@ -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)?;
|
||||
|
||||
Reference in New Issue
Block a user