1. Otherwise, the JSON_CONTAINS function returns 0.
Tip
All of the JSON functions and operators are listed in the navigation and on the overview page
Syntax
Parameters
-
json_target: the expression that represents the target JSON document. The document can be a JSON column, or a JSON object that is produced by a JSON constructor function such as PARSE_JSON. -
json_candidate: the expression that represents the candidate JSON value or subdocument to search for within the target. The value can be a JSON column, or a JSON object that is produced by a JSON constructor function such as PARSE_JSON.
Return value
Returns a BOOLEAN value.Usage notes
- For scalar values (strings, numbers, booleans, null), the function returns true if the values are equal.
- For JSON objects, the function returns true if the target object contains all key-value pairs from the candidate object.
- For JSON arrays, the function returns true if the target array contains all elements from the candidate array, or if the candidate is a single value contained in the target array.
- The function performs deep containment checking for nested structures.