Skip to content

Update

Update values of found objects

Prefix: update

Value: Vector of update operators

Can start the pipeline: No

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

Steps after: -

Operators:

  • Inc - inc{...}
  • Set - set{...}

Example

Input:

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

Output:

result:ok[
    response{
        s|data|:ids[
            test|48b7ab32-0c02-418f-9db9-ea753bc7959e|,
            test|4d67078d-c320-432b-bce9-56319498963b|,
            test|7b96eff7-19b1-44c9-905d-7467caf05393|,
            test|9285e8be-1d1f-4e7e-80cf-95686272e773|,
        ],
        s|meta|:update_meta{
            s|count|:n|4|,
        },
    },
];