Skip to main content

RelPredicate

Struct RelPredicate 

Source
pub struct RelPredicate {
    pub rel_name: String,
    pub as_name: String,
    pub model: String,
    pub local_field: String,
    pub foreign_field: String,
    pub filter: Option<Value>,
    pub nested: Vec<NestedRelFilter>,
    pub agg: Vec<(String, AggDef)>,
    pub having: Value,
    pub negated: bool,
}
Expand description

单个关系聚合谓词(归一表示)

Fields§

§rel_name: String

关系名(根 schema.relations 的键)

§as_name: String

$lookup.as(同时是代理字段前缀)

§model: String

目标 model(定位目标 schema 的唯一依据)

§local_field: String

关系本地键(根表标量列)

§foreign_field: String

关系外键(子表标量列,子 pipeline $group 键)

§filter: Option<Value>

子级过滤(已剥离嵌套关系路径;仅标量 / 对象点号路径 / 数组整值);None = 无

§nested: Vec<NestedRelFilter>

子级过滤中的嵌套关系下钻(一层;8c-2)

§agg: Vec<(String, AggDef)>

本块聚合别名 → 聚合定义(仅保留 having 引用到的)

§having: Value

谓词条件(仅可引用本块 agg 别名)

§negated: bool

否定($not / $exists:false)→ anti-join

Trait Implementations§

Source§

impl Clone for RelPredicate

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RelPredicate

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.