StringToBoolean (NoSQL クエリ)

適用対象: NoSQL

文字列式をブール値に変換します。

構文

StringToBoolean(<string_expr>)  

引数

説明
string_expr 文字列式。

戻り値の型

ブール値を返します。

次の例は、さまざまなデータ型でこの関数が機能する方法を示しています。

SELECT VALUE {
    parseBooleanString: StringToBoolean("true"),
    parseWithPrefix: StringToBoolean("true  "),
    parseWithSuffix: StringToBoolean("  false"),
    parseWithWhitespace: StringToBoolean("  false  "),
    parseBoolean: StringToBoolean(true),
    parseUndefined: StringToBoolean(undefined),
    parseNull: StringToBoolean(null)
}
[
  {
    "parseBooleanString": true,
    "parseWithPrefix": true,
    "parseWithSuffix": false,
    "parseWithWhitespace": false
  }
]

解説

  • この関数で、インデックスは使用されません。
  • 式を変換できない場合、関数は undefined を返します。

注意

JSON 形式の詳細については、「https://json.org」を参照してください。