UpdateImage

Updates existing Image objects that satisfy the specified constraints.

Parameters

  • [optional] _ref: Reference to other objects within the transaction.
  • [optional] unique: Indicates whether a single object is expected to satisfy the constraints.

Blocks

Details

Either _ref OR constraints must be specified.

If the _ref parameter is specified, it must refers to the search results of a previous FindImage or AddImage.

The remove_props parameter is an array of strings specifying the properties to be deleted (if any).

If search results are empty, this will cause an exception.

Examples

Find the images with the “year_captured” property equal to 2007, and remove the “focal_length” property:

[ {
    "UpdateImae" : {
        "class" : "Person",
        "constraints" : {
            "year_captured": [ "==", 2007 ],
        },
        "remove_props" : [ "focal_length" ]
    }
}]

Find an image with the “year_captured” property equal to 2007, verify that only one image satisfy the constraint, and update the “focal_length_mm” property:

[ {
    "UpdateEntity" : {
        "unique" : true,
        "constraints" : {
            "year_captured": [ "==", 2007 ],
        },
        "properties" : {
            "focal_length_mm": 55
        }
    }
}]