Skip to main content

fixture

Function fixture 

Source
pub fn fixture(
    doc: &mut Doc,
    obj: &ObjId,
    shape: &Value,
) -> Result<(), ModelError>
Expand description

Write the keys of the JSON object shape into the map obj as an older version of an app stored them: what a migration’s test builds the document it migrates from. An object is a map, an array a list, a string, a boolean and a number are scalars (an integer as Int), null is a null scalar, and {"$text": "…"} is a text object holding the string.

§Errors

Returns the document’s write error, or that shape is no object.