$kebabcase

Update records by converting a string column to kebab case format. The $kebabcase method is used to modify text fields by transforming the value into kebab case, where words are separated by hyphens and all characters are lowercase (e.g., “hello-world”). This is useful for formatting strings for URLs, slugs, or other cases where kebab case is required.

await Member.$update({
    $where: { 
        age: { 
            $eq: 16 
        } 
    },
    $update: {
       $kebabcase: {
         username: true
       }
    }
});

Last updated