संपादित करें

इसके माध्यम से साझा किया गया


StringToNull (NoSQL query)

APPLIES TO: NoSQL

Converts a string expression to null.

Syntax

StringToNull(<string_expr>)  

Arguments

Description
string_expr A string expression.

Return types

Returns a null.

Examples

The following example illustrates how this function works with various data types.

SELECT VALUE {
    parseNullString: StringToNull("null"),
    parseWithPrefix: StringToNull("null  "),
    parseWithSuffix: StringToNull("  null"),
    parseWithWhitespace: StringToNull("  null  "),
    parseUppercase: StringToNull("NULL"),
    parseTitlecase: StringToNull("Null"),
    parseNull: StringToNull(null),
    parseUndefined: StringToNull(undefined)
}
[
  {
    "parseNullString": null,
    "parseWithPrefix": null,
    "parseWithSuffix": null,
    "parseWithWhitespace": null
  }
]

Remarks

  • This function doesn't use the index.
  • If the expression can't be converted, the function returns undefined.

Note

For more information on the JSON format, see https://json.org.