View on GitHub

JODA - JSON On Demand Analysis

Efficient data wrangling for semi-structured JSON documents

IN - Array

Checks whether the element is contained in the array

Details

The element value can only be an atomic value (Number, String, Bool, Null)

Input parameters

Name Type Optional Description
element Any (Atomic) False  
array Array False  

Output

Bool:

Usage

IN(<element>, <array>)

Examples

Example 1

Input Document

[1,2,"String"]

Query

LOAD tmp
AS ('': IN("String", ''))

Result

true

Example 2

Input Document

{"arr":[1,2,"String"]}

Query

LOAD tmp
AS ('': IN(3, '/arr'))

Result

false