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|728dc014-9802-484e-9ba3-14297268d189|,
            test|16e99b5a-7085-425c-a3ce-a5cf60f07bb2|,
            test|fcb58259-36bb-42ad-b381-6392eb1c2a24|,
            test|d38e20de-615d-4f31-b3f2-a59c25c5496f|,
        ],
        s|meta|:update_meta{
            s|count|:n|4|,
        },
    },
];