$substrCP Operator in MongoDB
The $substrCP Operator in MongoDB is used in the aggregation pipeline to find substrings from a given string expression.
It uses the Unicode code point index and count to determine the substring. This makes it useful when working with strings that contain non-ASCII characters, as it handles the Unicode code points correctly.
For example: { $substrCP: [ “w3wiki”, 0, 5 ] } will give the output as “geeks” as 0 is given as starting location, and from there 5 characters need to be taken and hence “geeks” is the result
MongoDB $substrCP Operator
MongoDB $substrCP Operator extracts a substring from the given string expression.
Contact Us