REPLACE (NoSQL query)
APPLIES TO: NoSQL
Replaces all occurrences of a specified string value with another string value.
Syntax
REPLACE(<string_expr_1>, <string_expr_2>, <string_expr_3>)
Arguments
Description | |
---|---|
string_expr_1 |
A string expression to be searched. |
string_expr_2 |
A string expression to be found within string_expr_1 . |
string_expr_3 |
A string expression with the text to replace all occurrences of string_expr_2 within string_expr_1 . |
Return types
Returns a string expression.
Examples
The following example shows how to use this function to replace static values.
SELECT VALUE {
replaceSubstring: REPLACE("AdventureWorksLT", "LT", "LT2")
}
[
{
"replaceSubstring": "AdventureWorksLT2"
}
]
Remarks
- This function doesn't use the index.
Related content
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for