use mongodb::bson::Document;
use crate::options::FindOptions;
use crate::scope::Scope;
#[derive(Debug, Clone, PartialEq)]
pub struct CreateOp {
pub collection: String,
pub owner: String,
pub data: Document,
}
#[derive(Debug, Clone, PartialEq)]
pub struct GetOp {
pub collection: String,
pub id: String,
pub scope: Option<Scope>,
}
#[derive(Debug, Clone, PartialEq)]
pub struct FindOneOp {
pub collection: String,
pub criteria: Document,
pub fields: Option<Vec<String>>,
pub scope: Option<Scope>,
}
#[derive(Debug, Clone, PartialEq)]
pub struct CountOp {
pub collection: String,
pub criteria: Document,
pub scope: Option<Scope>,
}
#[derive(Debug, Clone, PartialEq)]
pub struct FindOp {
pub collection: String,
pub criteria: Document,
pub options: FindOptions,
pub scope: Option<Scope>,
}
#[derive(Debug, Clone, PartialEq)]
pub struct AggregateOp {
pub collection: String,
pub pipeline: Vec<Document>,
pub skip: u64,
pub limit: u64,
pub scope: Option<Scope>,
}
#[derive(Debug, Clone, PartialEq)]
pub struct UpdateOneOp {
pub collection: String,
pub id: String,
pub data: Document,
pub replace: bool,
pub scope: Option<Scope>,
}
#[derive(Debug, Clone, PartialEq)]
pub struct UpdateManyOp {
pub collection: String,
pub criteria: Document,
pub values: Document,
pub scope: Option<Scope>,
}
#[derive(Debug, Clone, PartialEq)]
pub struct DeleteManyOp {
pub collection: String,
pub criteria: Document,
pub scope: Option<Scope>,
}
#[derive(Debug, Clone, PartialEq)]
pub struct RestoreOp {
pub collection: String,
pub criteria: Document,
pub scope: Option<Scope>,
}
#[derive(Debug, Clone, PartialEq)]
pub struct VersionedUpdateOp {
pub collection: String,
pub id: String,
pub data: Document,
pub replace: bool,
pub max_versions: Option<u64>,
pub scope: Option<Scope>,
}