[][src]Struct wither::IntervalMigration

pub struct IntervalMigration {
    pub name: String,
    pub threshold: DateTime<Utc>,
    pub filter: Document,
    pub set: Option<Document>,
    pub unset: Option<Document>,
}

A migration type which allows execution until the specifed threshold date. Then will no-op.

This migration type works nicely in environments where multiple instances of the system — in which this migration is defined — are continuously running, even during deployment cycles. With an IntervalMigration, each instance will execute the migration at boottime, until the threshold date is passed. This will compensate for write-heavy workloads, as the final instance to be updated will ensure schema convergence. As long as you ensure your migrations are idempotent — WHICH YOU ALWAYS SHOULD — this will work quite nicely.

Fields

name: String

The name for this migration. Must be unique per collection.

threshold: DateTime<Utc>

The UTC datetime when this migration should no longer execute.

Use something like: chrono::Utc.ymd(2017, 11, 20).and_hms(22, 37, 34).

filter: Document

The filter to be used for selecting the documents to update.

set: Option<Document>

The document to be used for the $set operation of the update.

unset: Option<Document>

The document to be used for the $unset operation of the update.

Trait Implementations

impl Migration for IntervalMigration[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,