Questions tagged [nested-json]
114 questions
3
votes
2 answers
Insert/Add a json object in a dictionary at nested level dynamically
I am working on a script to generate some test data based on a json spec. The intention of this script is to construct a json object/python dict record
To simplify things, I am using a list items here that represents my source items, which also…

Prashanth kumar
- 949
- 3
- 10
- 32
3
votes
2 answers
How to use reduce method by loadash for nested/complex object
I have data like this
const faq =
{
Question1:{
question:’Question1’,
answer: {
Answer1_1: {
answer: ‘Answer1_1’
},
Answer1_2: {
answer: ‘Answer1_2’
}
}
},
Question2:{
…

kona B
- 95
- 1
- 6
3
votes
1 answer
How to update nested JSON object fields in mongo Db collection using ASP.NET Core
I have a JSON object(Form) in the mongo collection like this
{
"_id": "87124eb6-c9f7-49b9-8470-8c2b7fb07dc8",
"VisitName": "demo visit",
"Version": "string",
"FormStatus": "string",
"FormName": "demo form",
"IsDeleted":…

Aravind Shajan
- 107
- 5
2
votes
1 answer
How to convert csv to nested json
I have this csv file and wondering how to display result as expected ?
CSV File
order_date,customer_id,customername,order_id,total
22/06/2023,1,Allan,5,50
22/06/2023,2,Boy,2,150
Code
import JSON
import pandas as pd
df = pd.read_csv(file,…

jojo
- 21
- 2
2
votes
1 answer
Search through a nested array and object
Suppose there is a very long and nested JSON and you need to find a specific key value( "domain": "pack" inside that JSON and return the object containing that key value pair. The path to that key is something like…

Lelouch
- 53
- 4
2
votes
1 answer
Update multiple model data through one serializer
Please go through the description, I tried to describe everything i've encountered while trying to solve this issue.
I have two models, User and DoctorProfile. User model has OneToOne relation with DoctorProfile. I'm trying to update data of both…

Imtiaz Ahmed
- 123
- 3
- 12
2
votes
1 answer
Firestore - 'Nested arrays are not supported' (Flutter)
really struggling getting my data structure into firestore. the structure is something like this:
class1List[class1_index].class2List[class2_index].class3List[class3_index] etc...
ok so im using json_serializable and its tojson and fromjson…

XavierRenegadeAngel
- 83
- 1
- 8
2
votes
1 answer
Pandas MultiIndex dataframe to nested json
I have the following pandas multi-index dataframe and I would like it to become a nested json object.
import pandas as pd
data = {'store_id' : ['1', '1','1','2','2'],
'item_name' : ['apples', 'oranges', 'pears', 'persimmons', 'bananas'],
…

RTorres
- 53
- 5
2
votes
2 answers
Pythonic way to transform/flatten JSON containing nested table-as-list-of-dicts structures
Suppose I have a table represented in JSON as a list of dicts, where the keys of each item are the same:
J = [
{
"symbol": "ETHBTC",
"name": "Ethereum",
:
},
{
"symbol": "LTC",
"name": "LiteCoin"
…

P i
- 29,020
- 36
- 159
- 267
2
votes
0 answers
flattening nested Json in pyspark, where each array type would be a separate data frame
Taking this schema(json dataframe) as an example:
root
|-- abstract: string (nullable = true)
|-- adx_keywords: string (nullable = true)
|-- asset_id: long (nullable = true)
|-- byline: string (nullable = true)
|-- column:…

Sreedev Nair
- 21
- 3
1
vote
1 answer
Building nested Json from dataframe using pyspark
I have a dataframe and build a nested json object from this dataframe to represent the hieraical data, i am stuck where the json sub column is aded but its comming as string not as json.
**Code:**
from pyspark.sql.functions import *
#sample…

Manoj
- 61
- 6
1
vote
1 answer
Pyspark : creating a Nested json file
I want to create a nested json file from data in PySpark from the following data.
I wanted to convert this into Nested json file which should have following structure.
{ "NewData" : [ {"id":"1","number":"smith","name":"uber","age":12}, …

AutotelicLearner
- 17
- 3
1
vote
1 answer
Recursion error while simplifying nested json to flat in python
I am trying flatten the json object so that I can create plain csv file out of it.
But it is throwing
RecursionError: maximum recursion depth exceeded while calling a Python object
Code which I have written in python, calling…

Kalpesh
- 694
- 2
- 8
- 28
1
vote
2 answers
How should I store nested JSON object inside Cassandra?
This is the first time I am working with Cassandra and I have a data structure like following, want to save it inside the Cassandra:
{"user_id": "123",
"user_cards": {
"first_card": {
"card_number": 456
}
}
}
I searched through the…

best_of_man
- 643
- 2
- 15
1
vote
2 answers
How to get the correct info while extracting some particular key value from nested JSON
I want to extract the task name and config corresponding to each task into new variable.
The code that I have shared is not giving me the desired output. Although it is extracting some info but it is not able to extract all the required…

Professor
- 87
- 6