Skip to content

Delete

Remove found objects or the whole collection.

Prefix: delete

Value: no value. Prefix-only primitive

Can start the pipeline: No

Steps before: find, get, sort, limit, offset

Steps after: -

Example

Input:

collection|test|:q[
    find[
        gt{
            value|num|:n|5|,
        },
    ],
    delete,
];

Output:

result:ok[
    response{
        s|data|:ids[
            test|edade018-1f2c-48ec-8d69-e6353fe73154|,
            test|900eab76-59cd-49c8-af3f-e5125294dd04|,
            test|5113ba7d-88cc-47f4-b3cf-c0ef89257179|,
            test|d2210a19-968a-46f3-8e5d-09bd754fa229|,
        ],
        s|meta|:update_meta{
            s|count|:n|4|,
        },
    },
];