Macro avocado::filter[][src]

macro_rules! filter {
    ($($first:ident $(.$rest:ident)*: $value:expr,)*) => { ... };
    ($($first:ident $(.$rest:ident)*: $value:expr),*) => { ... };
}

Convenience macro for constructing a Filter.

Example:

let repo_filter = filter! {
    name: regex("^Avocado.*$"),
    author.username: "H2CO3",
    release_date: filter! {
        year: 2018,
    },
    stargazers: Type(BsonType::ARRAY),
    downloads: ne(1337) // trailing comma is allowed but optional
};