feat(smartdb): add operation log APIs, point-in-time revert support, and a web-based debug dashboard
This commit is contained in:
@@ -2,6 +2,7 @@ use std::collections::HashSet;
|
||||
|
||||
use bson::{doc, Bson, Document};
|
||||
use rustdb_query::QueryMatcher;
|
||||
use rustdb_storage::OpType;
|
||||
use tracing::debug;
|
||||
|
||||
use crate::context::CommandContext;
|
||||
@@ -171,6 +172,16 @@ async fn delete_matching(
|
||||
.await
|
||||
.map_err(|e| CommandError::StorageError(e.to_string()))?;
|
||||
|
||||
// Record in oplog.
|
||||
ctx.oplog.append(
|
||||
OpType::Delete,
|
||||
db,
|
||||
coll,
|
||||
&id_str,
|
||||
None,
|
||||
Some(doc.clone()),
|
||||
);
|
||||
|
||||
// Update index engine.
|
||||
if let Some(mut engine) = ctx.indexes.get_mut(ns_key) {
|
||||
engine.on_delete(doc);
|
||||
|
||||
Reference in New Issue
Block a user