.. _DeleteFrame: DeleteFrame =========== Deletes Frame objects that satisfy the specified constraints, and all the connections to/from those frame objects. Parameters ---------- Exactly one of ``ref`` or ``constraints`` is required. Supplying both is rejected. Use a preceding FindFrame to combine property and relationship filters, then pass its reference. .. 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. Selects existing frames by expression. Cannot be combined with ref. * - :ref:`ref ` - integer, 1 through 100000 - Optional. Select using the other supplied selectors; see the selection rule above. Uses an earlier compatible Frame reference in this transaction; forward references, wrong types, and undeclared references are rejected. Details ------- The **ref** and **constraints** parameters are mutually exclusive. To combine filters, use FindFrame first and update or delete through its reference. .. include:: delete_details.rst Response and errors ------------------- An authenticated session with the objects delete permission is required. The response is an object under ``DeleteFrame`` 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 Frame objects with "my_id" property equal to 22: .. TESTED_EXAMPLE: DeleteFrame_1 .. code-block:: json [{ "DeleteFrame": { "constraints": ["$my_id", "==", 22] } }] Successful response: .. TESTED_EXAMPLE: DeleteFrame_1_response .. code-block:: json [{ "DeleteFrame": { "count": 1, "status": 0 } }] Delete Frame objects with "source" property equal to "my_model", and with frame number greater than 10, and that have connections to a Video with the "year_captured" property equal to 1990: .. TESTED_EXAMPLE: DeleteFrame_2 .. code-block:: json [{ "FindVideo": { "_ref": 1, "constraints": ["$year_captured", "==", 1990] } }, { "FindFrame": { "_ref": 2, "in_frame_number_range": { "start": 10 }, "constraints": ["$source", "==", "my_model"], "video_ref": 1 } }, { "DeleteFrame": { "ref": 2 } }] Successful response: .. TESTED_EXAMPLE: DeleteFrame_2_response .. code-block:: json [{ "FindVideo": { "returned": 0, "status": 0 } }, { "FindFrame": { "returned": 0, "status": 0 } }, { "DeleteFrame": { "count": 1, "status": 0 } }]