ערוך

שתף באמצעות


IS_OBJECT (NoSQL query)

APPLIES TO: NoSQL

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

Syntax

IS_OBJECT(<expr>)  

Arguments

Description
expr Any expression.

Return types

Returns a boolean expression.

Examples

The following example various values to see if they're an object.

SELECT VALUE {
    isBooleanAnObject: IS_OBJECT(true),
    isNumberAnObject: IS_OBJECT(1),
    isStringAnObject: IS_OBJECT("value"),
    isArrayAnObject: IS_OBJECT([ "green", "red", "yellow" ]),
    isNullAnObject: IS_OBJECT(null),
    isObjectAnObject: IS_OBJECT({ "name": "Tecozow coat" }),
    isObjectStringPropertyAnObject: IS_OBJECT({ "name": "Tecozow coat" }.name),
    isObjectObjectPropertyAnObject: IS_OBJECT({ "quantity": { "count": 0 } }.quantity),
    isUndefinedAnObject: IS_OBJECT({}.category)
}
[
  {
    "isBooleanAnObject": false,
    "isNumberAnObject": false,
    "isStringAnObject": false,
    "isArrayAnObject": false,
    "isNullAnObject": false,
    "isObjectAnObject": true,
    "isObjectStringPropertyAnObject": false,
    "isObjectObjectPropertyAnObject": true,
    "isUndefinedAnObject": false
  }
]

Remarks