$prepend

Update records by prepending a specified value to the existing value in a column. The $prepend method is used to add new data to the beginning of an existing value, typically for text columns, ensuring that the original value is preserved while the new data is added at the start.

await Member.$update({
    $where: { 
        age: { 
            $eq: 16 
        } 
    },
    $update: {
        $prepend: {
            username: 'five'
        }
    }
});

Last updated