I am trying to figure out how to append a new value to the same property of an object. I have this code below: The value [member.displayName] changes every for loop, and I want every loop to create a new value within [todaysDate] with [member.displayName] property name. It currently replaces property names with the next name from the row, instead
Tag: json
Is there a way to optimize the upload of huge json files to mongodb
I am working on a project where I need to use a database in order to better manage my data, and so I decided to use MongoDB for performance reasons. After setting everything up, I made a script that uses a pipeline to download a zip file, unpack it, grab the XLS file inside and convert the content to JSON
React.Js and Typescript how to read data from JSON?
everyone. I am using MongoDB with mongoose and React.Js. I have a page where the user can display a post. I am sending fetch request to the backend where I am getting this json data as response. And on the frontend I am using Fetch API, to get this data, what I am trying to do is I want to
How can I transform a single json object into json array?
My axios api returns a JSON object in the format as follow. but I need to tranform each element in the JSON object into a JSON object of a JSON array into this format below. Answer Use Object.entries() to create an array of key / value pairs then map that to the structure you want The array will be sorted
reformatting json file to have identifying attribute and array to accomodate for sub-objects
I am trying to reformat some relatively unstructured json to fit my needs, where I want each object to have a ‘name’ attribute as well as a ‘children’ array for sub-objects. I have a json file that looks like below: I would like to format it to be something like this: How would I be able to do this recursively
How do i search by ID in json file? [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 8 months ago. Improve this question so let’s say i have this JSON file: And i need function that searches by ID,(“1”: / “2”: is ID basically) and saves it in
How get data stored in vars from a js file in python
I have a js file that I need to get data out of but I am not sure how to get the data out in the way I want. I would like it to be readable and subscriptable like a python dict(like dict[“key/value”]). just opening the file returns an <class ‘_io.TextIOWrapper’> but that doesn’t seem to be what I want.
How to access JSON object in javascript?
I want to select the “artist” and put it in the selector and I want to keep it in vannila javascript. I thought this would select the artist from my JSON file. My JSON And my javascript Answer Your loop won’t work because your parsed data is an object which doesn’t have a length property. If you just want the
How to load into HTML table just first 5 items from json file with JavaScript and JQuery?
I want to display first e.g. 5 items from json file using JavaScript/JQuery. I have the following .json file named draws.json which is like this: This is just a small part of it. I want to display only first 5 items from it. One single item would be for example: I want to load into my HTML table just date,
gRPC: Unknown JSON as input and output
I’m new to gRPC, I’m trying to expose gRPC server in which and rpc does not have known shape before hand. Requirement is that particular field can have any value present in it. Ex: file.proto When i went through the docs there is no way we can create gRPC server without knowing the fields before hand. For this struct to