Partager via


STRINGTONULL - Langage de requête dans Cosmos DB (dans Azure et Fabric)

La STRINGTONULL fonction convertit une expression de chaîne en null.

La STRINGTONULL fonction convertit une expression null de chaîne dans Azure Cosmos DB pour NoSQL.

Syntaxe

STRINGTONULL(<string_expr>)

Arguments

Descriptif
string_expr Expression de chaîne.

Types de retour

Retourne un null.

Examples

Cette section contient des exemples d’utilisation de cette construction de langage de requête.

Convertir une chaîne en null

Dans cet exemple, la STRINGTONULL fonction est utilisée pour convertir différentes expressions de chaîne en null.

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
  }
]

Remarques

  • Cette fonction n’utilise pas l’index.
  • Si l’expression ne peut pas être convertie, la fonction retourne undefined.