Rediger

Del via


IS_BOOL (NoSQL query)

APPLIES TO: NoSQL

Returns a boolean value indicating if the type of the specified expression is a boolean.

Syntax

IS_BOOL(<expr>)  

Arguments

Description
expr Any expression.

Return types

Returns a boolean expression.

Examples

The following example checks objects of various types using the function.

SELECT VALUE {
    booleanIsBool: IS_BOOL(true),
    numberIsBool: IS_BOOL(65),  
    stringIsBool: IS_BOOL("AdventureWorks"),   
    nullIsBool: IS_BOOL(null),  
    objectIsBool: IS_BOOL({size: "small"}),   
    arrayIsBool: IS_BOOL([25344, 82947]),  
    arrayObjectPropertyIsBool: IS_BOOL({skus: [25344, 82947], vendors: null}.skus),
    invalidObjectPropertyIsBool: IS_BOOL({skus: [25344, 82947], vendors: null}.size),
    nullObjectPropertyIsBool: IS_BOOL({skus: [25344, 82947], vendors: null}.vendor)
}
[
  {
    "booleanIsBool": true,
    "numberIsBool": false,
    "stringIsBool": false,
    "nullIsBool": false,
    "objectIsBool": false,
    "arrayIsBool": false,
    "arrayObjectPropertyIsBool": false,
    "invalidObjectPropertyIsBool": false,
    "nullObjectPropertyIsBool": false
  }
]

Remarks