MongoDB $split

In MongoDB, the $split aggregation pipeline operator divides a string into an array of substrings based on a delimiter.

The delimiter is removed from the string, and the substrings are added as elements to the array.

To use $split, you specify the string and the delimiter.

If the delimiter isn’t found in the string, the original string is returned as the only item in the array.

Continue reading