DeleteImage =========== Deletes Image objects that satisfy the specified constraints, and all the connections to/from those image objects. Parameters ---------- ``ref`` and ``constraints`` are optional and are intersected when both are present. **Scope warning:** omitting all selectors targets every Image object. Always supply selectors for a scoped mutation. .. list-table:: :header-rows: 1 :widths: 15 25 60 * - Parameter - JSON type - Behavior * - :ref:`constraints ` - array expression - Optional. No property filter; the command-specific selector requirement still applies. Filters existing objects using the constraints expression language. When ref is supplied it filters that referenced set. * - :ref:`ref ` - integer, 1 through 100000 - Optional. Select using the other supplied selectors; see the selection rule above. Uses an earlier compatible Image reference in this transaction; forward references, wrong types, and undeclared references are rejected. Details ------- If the **ref** parameter is used, **constraints** will act as additional filters on the referenced result set. For remote images, the metadata is deleted but the original images in the remote storage are not. .. include:: delete_details.rst Response and errors ------------------- An authenticated session with the objects delete permission is required. The response is an object under ``DeleteImage`` with integer ``status`` and, on success, integer ``count``. Status 0 means the mutation completed; count is the number of selected objects affected, including zero when none match. No output blobs are returned. Count covers the parent objects, excluding deleted children. Invalid field types, missing required fields, malformed expressions, and invalid references fail validation. Execution failures include a nonzero status and an ``info`` message; inspect the transaction response before assuming a mutation succeeded. Image deletion also removes its bounding boxes and polygons. Deleting nodes also removes incident connections. Managed content is scheduled for reclamation; externally referenced URL objects are not deleted. Examples -------- Delete image with "unique_id" property equal to 22: .. TESTED_EXAMPLE: DeleteImage_1 .. code-block:: json [{ "DeleteImage": { "constraints": ["$location", "==", "Seattle, WA"] } }] Successful response: .. TESTED_EXAMPLE: DeleteImage_1_response .. code-block:: json [{ "DeleteImage": { "count": 1, "status": 0 } }] Delete image with "unique_id" property equal to 22 and connections to entities of class "Person" with the "age" property equal to 30: .. TESTED_EXAMPLE: DeleteImage_2 .. code-block:: json [{ "FindEntity": { "_ref": 1, "with_class": "Person", "constraints": ["$age", "==", 30] } }, { "FindImage": { "_ref": 2, "blobs": false, "constraints": ["$location", "==", "Cordoba, Argentina"], "is_connected_to": { "ref": 1 } } }, { "DeleteImage": { "ref": 2 } }] Successful response: .. TESTED_EXAMPLE: DeleteImage_2_response .. code-block:: json [{ "FindEntity": { "returned": 0, "status": 0 } }, { "FindImage": { "status": 0, "returned": 0 } }, { "DeleteImage": { "count": 1, "status": 0 } }]