struct
Command
pub struct Command {
pub action: Action,
pub collection: String,
pub filter: Value,
pub sort: Value,
pub projection: Value,
pub limit: Option<i64>,
pub skip: Option<u64>,
pub document: Value,
pub pipeline: Value,
}One database operation, as JSON (filters in MongoDB Extended JSON, so {"_id": {"$oid": "…"}} matches an ObjectId).
Fields
Methods
check
pub fn check(self, policy: &Policy) -> Result<Command, String>Validate against policy: an allowed collection and access, no server-side JavaScript ($where, $function, $accumulator), no writes to other collections from a pipeline ($out, $merge), and a capped limit. Returns the command with the limit applied.
Trait implementations
- impl Clone for Command
- impl Debug for Command
- impl PartialEq for Command
impl Serialize for Command- impl StructuralPartialEq for Command
impl<'de> Deserialize<'de> for Command