datastack 0.4.0

A document-based acid local database.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use serde_json::{json, Value as Json};

pub fn increment<T: Into<Json>>(amount: T) -> Json {
    json!({ "__op": "inc", "amount": amount.into() })
}

pub fn remove() -> Json {
    json!({ "__op": "remove" })
}

pub fn array_union(values: Json) -> Json {
    json!({ "__op": "array_union", "values": values })
}

pub fn array_remove(values: Json) -> Json {
    json!({ "__op": "array_remove", "values": values })
}