revolt_database/models/safety_snapshots/ops/mongodb.rs
1use revolt_result::Result;
2
3use crate::MongoDb;
4use crate::Snapshot;
5
6use super::AbstractSnapshot;
7
8static COL: &str = "safety_snapshots";
9
10#[async_trait]
11impl AbstractSnapshot for MongoDb {
12 /// Insert a new snapshot into the database
13 async fn insert_snapshot(&self, snapshot: &Snapshot) -> Result<()> {
14 query!(self, insert_one, COL, &snapshot).map(|_| ())
15 }
16}