JSON_EXTRACT_BIGINT

Overview

Extracts a value from a JSON object by path and returns it as BIGINT. Returns NULL if the path does not exist or the value is null.

Syntax

JSON_EXTRACT_BIGINT(<json>, <path>)

Parameters

  • <json>: JSON type, the source data. Strings must first be converted using PARSE_JSON.
  • <path>: STRING type, a JSONPath expression such as '$.field'.

Examples

SELECT json_extract_bigint(PARSE_JSON('{"id":9999999999}'), '$.id'); -- 9999999999 -- Path does not exist, returns NULL SELECT json_extract_bigint(PARSE_JSON('{"id":1}'), '$.other'); -- NULL