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.