fix(mongodb): support createUser shell commands

Closes #5639
This commit is contained in:
t8y2 committed 2026-08-09 15:51:04 +08:00
1 parent e7f496bf0b
commit 9e3013adf9
25 files changed
+481 -12

No files matched your search

+18
View File
@@ -1138,6 +1138,24 @@ impl DbxBackend for WebBackend {
Value::String(value.get("name").and_then(Value::as_str).unwrap_or("").to_string()),
))
}
MongoCommand::CreateUser { user_json, write_concern_json } => {
let value: Value = self
.request(
reqwest::Method::POST,
"/api/mongo/create-user",
Some(json!({
"connectionId": connection_id,
"database": database,
"userJson": user_json,
"writeConcernJson": write_concern_json,
})),
)
.await?
.json()
.await
.map_err(|error| format!("Invalid MongoDB create user response: {error}"))?;
Ok(affected_query_result(affected_rows_from_value(&value)))
}
MongoCommand::DropIndexes { collection, indexes, single } => {
let value: Value = self
.request(