join
$join
Join the input array elements into a string using the provided separator.
Parameters
separator(string, required): The value to use for joining
If the input is not an array, it is treated as a single element. Follows the behavior of JavaScript's Array.prototype.join()
Example
// Join array elements with a comma (default)
new Schema('array').transformer('$join')
// ['a', 'b', 'c'] → 'a,b,c'
// Join with a custom separator
new Schema('array').transformer({$join: {separator: ' | '}})
// ['admin', 'read', 'write'] → 'admin | read | write'
// Split then rejoin with normalized separators
new Schema('string').normalizer([{$split: {separator: /[,;]/}}, {$each: '$trim'}])
.transformer({$join: {separator: ', '}})