.. _DeleteClip: DeleteClip =========== Deletes Clip objects that satisfy the specified constraints and all the connections to or from those clip objects. Parameters ---------- At least one of ``ref`` or ``constraints`` is required. When both are present, the constraints further restrict the referenced objects. .. 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 Clip reference in this transaction; forward references, wrong types, and undeclared references are rejected. Details ------- If the **ref** parameter is used, then **constraints** will act as additional filters on the referenced result set. .. include:: delete_details.rst Response and errors ------------------- An authenticated session with the objects delete permission is required. The response is an object under ``DeleteClip`` 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. 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. Deleting nodes also removes incident connections. Examples -------- Delete all Clip objects with "name" property equal to "Isolated Island"; this will effect all clips attached to all videos in the database. .. TESTED_EXAMPLE: DeleteClip_1 .. code-block:: json [{ "DeleteClip": { "constraints": ["$name", "==", "Isolated Island"] } }] Successful response where 1 clip is deleted: .. TESTED_EXAMPLE: DeleteClip_1_response .. code-block:: json [{ "DeleteClip": { "count": 1, "status": 0 } }] Delete Clip objects with "name" property equal to "Room 237" that have connections to a Video with the "name" property equal to "The Shining": .. TESTED_EXAMPLE: DeleteClip_2 .. code-block:: json [{ "FindVideo": { "_ref": 1, "constraints": ["$name", "==", "The Shining"] } }, { "FindClip": { "video_ref": 1, "_ref": 2, "constraints": ["$name", "==", "Room 237"] } }, { "DeleteClip": { "ref": 2 } }] Successful response where 1 clip is deleted: .. TESTED_EXAMPLE: DeleteClip_2_response .. code-block:: json [{ "FindVideo": { "returned": 0, "status": 0 } }, { "FindClip": { "returned": 0, "status": 0 } }, { "DeleteClip": { "count": 1, "status": 0 } }]