2

I have JSON documents of below format:

{
  "id":"1005",
  "config":{
      "properties":["ABC_001", "DEF_002", "PQR_009"]
   }
}

How can I search for a particular config.properties that matches pattern '%ABC%' and has an id=1005. In the above case, my output should be

config.properties:ABC_001

1 Answer 1

3

This gets you close:

select prop as `config.properties` 
from test unnest config.properties prop
where test.id = "1005" and prop like '%ABC%'

Here's the output:

[
  {
    "config.properties": "ABC_001"
  }
]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.