skip to Main Content

Simplifying multiple accesses to JSON files in a Javascript script

I am creating a map based on online datasets using the following code: <script src="https://unpkg.com/[email protected]/dist/leaflet.js" integrity="sha512-GffPMF3RvMeYyc1LWMHtK8EbPv0iNZ8/oTtHPx9/cc2ILxQ+u905qIwdpULaqDkyBKgOaB57QTMg7ztg8Jm2Og==" crossorigin=""></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/chroma-js/2.1.0/chroma.min.js" integrity="sha512-yocoLferfPbcwpCMr8v/B0AB4SWpJlouBwgE0D3ZHaiP1nuu5djZclFEIj9znuqghaZ3tdCMRrreLoM8km+jIQ==" crossorigin="anonymous"></script> <script> const API_IRIS_CONTOUR = new Request("https://www.loicbertrand.eu/accidentologie/json/iris_75.json"); const API_INSEE_STAT = new Request("https://www.loicbertrand.eu/accidentologie/json/base-ic-logement-2020_paris.json"); var layer_iris = L.layerGroup() var color_scale = chroma.scale(['yellow',…

VIEW QUESTION

How to have JSON subquery return empty array rather than null when there are no rows

I have a (hypothetical) JSON schema that calls for a document to look like: [ { "tableName": "Embeddings", "object_id": 1301579675, "type_desc": "USER_TABLE", "create_date": "2023-05-03T19:41:56.940", "indexes": [ { "name": "PK_Embeddings", "type_desc": "CLUSTERED", "is_unique": true, "is_primary_key": true }, { "name": "IX_Embeddings_DimValue", "type_desc":…

VIEW QUESTION

Json – how to parse this data and extract two values

I am trying to extract two values: iid device_id { 'Cookies': { 'install_id': '7296374090783672107', 'store-country-code': 'us', 'store-country-code-src': 'did', 'store-idc': 'useast5', 'ttreq': '1$ae2625a14f85ea1578eaedbecdca21116587d1bf' }, 'Device_Info': { 'ab_version': '31.9.1', 'ac': 'wifi', 'ac2': 'wifi', 'aid': '1233', ..., 'device_brand': 'oneplus', 'device_id': '7296372688908764714', 'device_platform': 'android',…

VIEW QUESTION

Parse multilevel json into a csv using jq tool in unix

I have a multilevel json like so: { "id": "id123", "details": { "prod": "prod123", "etype": "type1" }, "accounts": [ { "bankName": "bank123", "accountType": "account123", "openingBalance": "bal123", "fromDate": "2023-01-01", "toDate": "2023-01-01", "missingMonths": [], "transactions": [ { "dateTime": "2020-12-01", "description": "a very…

VIEW QUESTION

Getting all the information out of a JSON in PostgreSQL

I have a JSON that looks like this: "[{""email"": ""AAA"", ""updated_at"": ""AAA"", ""net_income_verified"": AAA}, {""email"": ""BBB"", ""updated_at"": ""BBB"", ""net_income_verified"": BBB}, {""email"": ""CCC"", ""updated_at"": ""CCC"", ""net_income_verified"": CCC}]" And I would like to get all the data from all the fields so…

VIEW QUESTION
Back To Top
Search