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
1
vote
0 answers

How to filter yaml values based on sub-key and collapse them

I am trying to filter a YAML config file and collapse them based on a key. For an ansible playbook I use the following config virtual_hosts: - vname: example server_name: "www.example.com example.com" port: 443 …
DuppyWeb
  • 43
  • 1
  • 4
1
vote
1 answer

crosstab in jasper displays only the first column from input json

my json is as follows "values": [ { "purchase": { "name":"bags" }, "weekSpend": [ { "weekStartDate": 20181105, …
Anjana
  • 109
  • 10
1
vote
1 answer

Filtering addresses matching condition

I want to provide list of allowed VLAN's as a variable to my server. Ansible playbook should be able to filter server's IP addreses based on this VLAN's. I have a list of all IP addresses available on server (ansible_all_ipv4_addresses from ansible…
Halis
  • 367
  • 1
  • 9
1
vote
1 answer

Oracle JSON Array query

My version: Oracle Database 12c Standard Edition Release 12.1.0.2.0 - 64bit Production CREATE TABLE DUMMY1 (id int NOT NULL PRIMARY KEY, doc1 VARCHAR2 (200) , doc2 VARCHAR2 (200), CONSTRAINT dummy_json1 CHECK (doc1 IS JSON) , CONSTRAINT dummy_json2…
Jidong Xin
  • 119
  • 1
  • 6
1
vote
1 answer

How to traverse the mongodb(JSON) document using queries

My json document is { "_id" : ObjectId("5b6049f845d12b6b62bf6fca"), "original_query" : "", } I want to traverse each person who are in like field and then store their fb_id in a list using python. I am new to mnogodb and JSON and any leads and…
Dumb
  • 43
  • 1
  • 1
  • 9
1
vote
2 answers

Trying to extract values from aws-cli response using jq but failing, what am I doing wrong?

I have the following json structure: [ { "IsDefault": false, "CidrBlock": "172.19.0.0/16", "DhcpOptionsId": "dopt-37fd70550", "State": "available", "CidrBlockAssociationSet": [ { "CidrBlockState": { …
Itai Ganot
  • 5,873
  • 18
  • 56
  • 99
1
vote
1 answer

Nest Json Array merge

I have a column saved json data in my table: declare @json nvarchar(max) set @json = N' { "Companies": [ { "CompanyId": "A", "Employee": null }, { "CompanyId": "B", …
Max
  • 4,439
  • 2
  • 18
  • 32
1
vote
1 answer

Json Path querying without an array

In the below JSON I am trying to find a condition.Where I want the result only if OrderNumber is not empty or null. Conditions I have tried. But havent worked for me are: > $..Item[?(@.OrderNumber)] > $..Item[?(@.CurrentOrder.OrderNumber)] Any…
Richard
  • 381
  • 2
  • 4
  • 22
1
vote
1 answer

extract several values from json using json query ansible

I m having a file like: { "account": "/system1/test", "description": "", "desired_state": "active", "id": "f957e20c-0033-4523-9020-e31304401149", "status": "active", "tags": [], …
Phil Di
  • 11
  • 1
  • 3
1
vote
0 answers

Oracle 12c: use JSON_QUERY in a trigger

I have a CLOB Json in a column of a table with the following structure: {"sources": [1,2,4]} I'm trying to write a trigger that read the array [1,2,4] and performs some checks: I'm trying using: DECLARE TYPE source_type IS TABLE OF NUMBER; SOURCES…
user2010955
  • 3,871
  • 7
  • 34
  • 53
1
vote
2 answers

How to find all the json key-value pair by matching the value using json query

I have below JSON structure : { "key" : "value", "array" : [ { "key" : 1 }, { "key" : 2, "misc": { "a": "Apple", "b": "Butterfly", "c": "Cat", "d": "Dog" …
1
vote
1 answer

Escape double quotes in json functions mysql

I know it should be simple, but I can't figure out how to escape the double quotes inside mysql query for json manipulation. I have the following example: SET @j = '{"4": 1, "0as@x"" : [1, 2, 3, 4], "b": [2, 3]}'; Please pay attention to the double…
cristighr
  • 13
  • 5
1
vote
1 answer

How to create this json projection on JMESPath?

is this doable with JMESPath? i want to transform this { "common": "value", "subdicts": { "first": {"sub" : 10}, "second": { "sub": 20} } } to [ {"common": "value", "sub": 10}, {"common": "value", "sub": 20} ]
laerus
  • 11
  • 3
0
votes
0 answers

In Java how to add field to json using com.amazonaws jmespath-java?

i am trying to query json using com.amazonaws jmespath-java from https://mvnrepository.com/open-source/json-query. I didn't find documentation of usage of above library in Java. Querying is possible in javascript,python and i am looking to consume…
Nagappa L M
  • 1,452
  • 4
  • 20
  • 33
0
votes
1 answer

Ansible: Task giving error when trying to parse 'ansible_facts'

I am fairly new to Ansible and am trying to create a playbook that will look at my Docker Swarm machines, check what NFS shares are already mounted, mount specified NFS shares from a list if they are not already there and unmount any NFS shares that…