luisvenezian
luisvenezian

Reputation: 501

Invalid JSON Path _id.$oid bigquery

I have this JSON data in a BigQuery column:

SELECT JSON '{"$oid":"123"}'

How can I get the $oid value?

Expected output: 123

Upvotes: 0

Views: 35

Answers (1)

luisvenezian
luisvenezian

Reputation: 501

  SELECT JSON_QUERY(JSON '{"$oid":"123"}', '$."$oid"')

Upvotes: 0

Related Questions