Questions tagged [json-query]

Use this tag for tasks involving queries against a JSON document, such as extracting JSON components from a JSON text. The tag can also be used for query languages intended for specifying such queries.

254 questions
0
votes
3 answers

Oracle reading JSON data using json_query

While working on oracle json datatype and trying to extract data from it, not able to extract name & value elements from this. tried using all known notations but getting null. select json_query(po_document, '$.actions.parameters[0]') from…
0
votes
1 answer

SQL JSON Query -retrieve data within a JSON array

I have the following SQL "Product" table structure: int Id nvarchar(max) Details Details contains JSON a string having the following structure: { "Id": "10001", "Description": "example description", "Variants": [{ "Title": "ABC / no", …
Razvan Olariu
  • 59
  • 1
  • 8
0
votes
1 answer

How to search in ansible for any variable that has a matching attribute

I have a variable named myvar, which is defined as follows - debug: var=myvar ok: [127.0.0.1] => { "myvar": { "name": "george" "description": "blah blah" } } I want to search for that variable based on the name attribute.…
Georgios F.
  • 417
  • 5
  • 15
0
votes
1 answer

how to filter multiple keys value from json output using JMESPATH or json_query to use in ansible?

I want to filter every keys value from below json using json_query | JMESPATH, how to achieve this? { "facts_hash": { "processors::count": "96", "processors::physicalcount": "2", "processor0": "Intel(R) Xeon(R) Gold 6252 CPU @…
Bharat Gupta
  • 127
  • 1
  • 10
0
votes
1 answer

Unable to render JasperReport for JSON with multiple detail records

We are trying to build a JasperReport for an estimate via JSON. The header and lines (multiple) are fine. However, there is one more node in the JSON file which requires to be looped in the detail table. We are not able to achieve it using…
Sriram
  • 36
  • 3
0
votes
2 answers

Why does to_nice_yaml produce quotes around the result in Jinja2 (Ansible)?

I have the following setup. my_var has the following value. ansible_facts: discovered_interpreter_python: /usr/bin/python invocation: module_args: api_key: null api_version: v1 ca_cert: null client_cert: null …
Tony Stark
  • 2,318
  • 1
  • 22
  • 41
0
votes
3 answers

How to query in json start with same name key using json query?

I have below json i want to take out all the macaddress list in one jason array how do i do ? { "facts_hash": { "lib": "/usr/share/fdi/facts:/opt/extension/facts", "interfaces": "eno1,eno2,eno3,eno4,eno5,eno6,ens3f0,ens3f1,lo", …
Bharat Gupta
  • 127
  • 1
  • 10
0
votes
1 answer

Ansible jinja2 compare strings non case sensitive

I have following complex dictionary (this is just a sample). And I'm trying to grab a list of all ids which belong to server1. Name of the server1 is in mixed cases. I tried jinja2 filters like match, search, equalto but none of them returns…
Marek
  • 127
  • 1
  • 8
0
votes
1 answer

SQL Server: How to remove a key from a Json object

I have a query like (simplified): SELECT JSON_QUERY(r.SerializedData, '$.Values') AS [Values] FROM r WHERE ... The result is like this: { "2019":120, "20191":120, "201902":121, "201903":134, "201904":513 } How can I remove the…
Bart
  • 144
  • 1
  • 12
0
votes
2 answers

Like operation on Json object in postgresql

I have the JSON column in my table which is having array's of dictionary. The array has standard format. [{'path': 'chat/xyz.pdf', 'file_name': 'xyz.pdf'}, {'path': 'chat/xyl.pdf', 'file_name': 'xyl.pdf'}] The table name is chat and column name is…
0
votes
2 answers

Ansible json_query how to remove square bracket & double quote

I want to filter this variable hp but it getting print as square bracket with "". how do i remove square bracket with "" just to get the only value. can someone please help here ? I was looking as regex but not able to find the exact…
Bharat Gupta
  • 127
  • 1
  • 10
0
votes
1 answer

Defining data type of a Google Charts DataTable column after it has been created

I am a newbie of Google charts. I am trying to change data type of a google chart data table column after this has been created. Searching for a solution over the internet I have bumped into this solution for a datetype column. May you generalize it…
fdrigo
  • 191
  • 1
  • 4
  • 14
0
votes
0 answers

Is there a way to UPDATE values based on WHERE conditions between two JSON files

Say I have two versions of the same JSON data. Each object has a unique ID key/pair. Say in one version a certain key has null as its value while the other version has the appropriate values for that key. Can we match the objects between the two…
BharathYes
  • 787
  • 2
  • 9
  • 25
0
votes
1 answer

SQL Server: How to update all the keys inside an json array

I have a query like (simplified): SELECT JSON_QUERY(r.SerializedData, '$.Values') AS [Values] FROM
r WHERE ... The result is like this: { "201902":121, "201903":134, "201904":513 } How can I change this in SQL to: {…
Bart
  • 144
  • 1
  • 12
0
votes
1 answer

How to extract object from array by json_query?

I have got json from variable like below. [ { "policyName1": { "resourceType": "Name1Type", "id": "uuid-0000-000-0-1", "extraAttr1": [ { "network11": { "allowAction": "yes", …
Sebastian
  • 15
  • 4