View on GitHub

JODA - JSON On Demand Analysis

Efficient data wrangling for semi-structured JSON documents

MEMCOUNT - Object

Returns the number of members in the object

Input parameters

Name Type Optional Description
obj Object False  

Output

Number: Number of attributes

Usage

MEMCOUNT(<obj>)

Examples

Example 1

Input Document

{"a":1, "b":{"c": true}}

Query

LOAD tmp
AS ('': MEMCOUNT(''))

Result

2

Example 2

Input Document

{"a":1, "b":{"c": true}}

Query

LOAD tmp
AS ('': MEMCOUNT('/b'))

Result

1