[][src]Trait avocado::ops::Distinct

pub trait Distinct<T: Doc>: Debug {
    type Output: for<'a> Deserialize<'a>;

    const FIELD: &'static str;
    fn filter(&self) -> Document { ... }
fn transform(raw: Bson) -> Result<Bson> { ... }
fn options() -> DistinctOptions { ... } }

A query for returning the distinct values of a field.

Associated Types

type Output: for<'a> Deserialize<'a>

The type of the field of which the distinct values will be returned.

Loading content...

Associated Constants

const FIELD: &'static str

The name of the field of which the distinct values will be returned.

Loading content...

Provided methods

fn filter(&self) -> Document

Optional filter restricting which values are taken into account. Defaults to no filtering.

fn transform(raw: Bson) -> Result<Bson>

Optional transform applied to each returned raw BSON. Can be used to adjust the structure of the loosely-typed data so that it fits what is expected by <Self::Output as Deserialize>::deserialize().

The default implementation just returns its argument verbatim.

fn options() -> DistinctOptions

Options for this query.

Loading content...

Implementations on Foreign Types

impl<T: Doc, Q: Distinct<T>, '_> Distinct<T> for &'_ Q
[src]

type Output = Q::Output

Loading content...

Implementors

Loading content...