All Questions
4,880
questions
-2
votes
2
answers
42
views
I want to return a key using Lodash when it contains a particular value
I have an object like this:
const obj = {
'MONEY-OUT': {
USD: ['a', 'b', 'c'],
EUR: ['d', 'e', 'f'],
},
'MONEY-IN': {
USD: ['g', 'h', 'i'],
EUR: ['j', 'k', 'l'],
},
};
and I ...
-1
votes
0
answers
20
views
understanding json_decode data [duplicate]
When I use json_decode and look at the results, I get a list of objects and arrays. I specifically want to retrieve one piece of information, but I'm not sure how to get it. I seem to have a stdClass ...
0
votes
1
answer
37
views
Deserializing JSON list into class objects not able to extract attributes
I'm struggling to deserialize my json-file into an array of objects of my class LeagueAcc.
I wanna fill a list with objects of class LeagueAcc called:
accounts = []
I have loaded my JSON successfully ...
-1
votes
0
answers
18
views
AsyncStorage React Native how can i store an object with multiple arrays inside?
i have been using asyncstore these days in react native and it works okay when storing tokens and simple objects. But i has a model like this (an object with arrays inside)
"_id": {
&...
-1
votes
2
answers
44
views
keep getting TypeError: array.push is not a function when trying to push an object into an existing array with objects
I'm learning about localStorage and I'm trying to build a basic shopping cart function. The process is:
user clicks on "Add To Cart" button.
If localStorage("shoppingCart") doesn'...
2
votes
1
answer
34
views
Extract JSON array from object (redshift)
I need to extract data from an array nested inside an object (let's say the column it lives in is metadata). It looks like the following:
{
"name": "abc",
"references&...
-2
votes
1
answer
60
views
TypeScript nested object how to access them?
I am working with a code that returns JSON | null type, hoping to change the value of a specific properties if those properties are
some function...
return {
property_one: some_obj....
0
votes
1
answer
39
views
How to render an object from a graphql database API fetch request in react native
Posting a request to the graphql API returns an object which can be observed in console log (see example output). The response can also be assigned to a variable intended to be rendered in a flatlist. ...
0
votes
4
answers
66
views
Loop through array of objects, sum array elements and put result in last element
I have an array of objects as follows. Each object has an array P2 inside it.
let input = [
{ "P2": [ 6, 6, 0 ] },
{ "P2": [ 3, 2, 0 ] },
{ "P2": [ 5, 1, ...
0
votes
1
answer
38
views
I have been trying to upload a file to an api but getting this error Objects are not valid as a React child, use an array instead
I have been trying to submit a file to my API but I am getting this:
Objects are not valid as a React child. If you meant to render a collection of children, use an array instead.
Below is my code ...
1
vote
1
answer
69
views
Access nested objects in C#
I am trying to access specific properties from my object via Google Books API. The content is deserialized into two POCOs to access the nested object. I am stuck on is accessing the properties of ...
0
votes
0
answers
13
views
gettng error"Converting circular structure to JSON"
I'm making a static website using react, boot strap and tailwind. Whenever I try to render Service.js file in react app using react router, I'm getting below error.
Uncaught TypeError: Converting ...
2
votes
3
answers
90
views
Find objects of a certain length inside the object
I need to go through the json object and find keys-objects, keys-arrays whose size matches a given value.
I can't understand where to set the conditions.
function traverse(obj, size) {
for (let ...
0
votes
0
answers
15
views
Create a tree array using string id in javascript [duplicate]
I have an array of comment and its replies as follows:
[
{
id:"comment 1",
data: "data1",
parent: "comment 0"
},
{
id:"comment 2",
data: "data2",
...
0
votes
1
answer
29
views
ArgumentError: Unknown field error Ruby JSON.parse(json_string, object_class: XYZ)
My Ruby class Routeguide::Rectangle object looks like this, (Pay attention on lo & hi variables, those are objects of class Routeguide::Point)
<Routeguide::Rectangle: lo: <Routeguide::Point: ...
0
votes
0
answers
14
views
Creating an XML object collection
I have an XML file and that needs to be converted into a specific json format with Items in it.
Items will be a collection where it can have 1 or 2 items in it based on my XML file. When i am `trying ...
0
votes
2
answers
93
views
Access inner keys in json data in typescript
I have this following object
{
"Monday": [
{
"morning": [
{
"start_time": "02:00",
...
0
votes
1
answer
90
views
use a value instead of an index in array object
I can't seem to format my array that is being saved to localStorage.
Can you change the index value of an array?
I have an array object like this:
const myArray = [{id: 41, name: "x"}, {id: ...
-2
votes
1
answer
21
views
Unable to append the object creation while loop for the JSON format [closed]
I am unable to append the result object to existing one, Can anyone pls help me here
Here is my data
var data = [];
data.push("result");
while(inc.next()){
data.push({
"...
0
votes
1
answer
75
views
Append new keys to a JSON array
I have this JSON array that Zabbix retrieves as a string and each object has the keys "startTime" and "endTime" which are date-time strings in the format of "DD-MM-YYYY HH:mm:...
0
votes
1
answer
48
views
How can I return matching query from array of objects?
I have an array of JSON objects to be output, where if the user enters an input the system will return the matching records, looking at name, mobileNumber, hobbies and gender.
<template>
<...
1
vote
3
answers
126
views
Type Mismatch Object and Integer
m.CurrDateObject = FindCurrDateObject(m.itemContent.date)
?"title :"m.CurrDateObject.title //Here I got Type Mismatch Error When 0 comes
?"text :"m.CurrDateobject.text
'...
0
votes
0
answers
16
views
My data from axios doesn't save in my global variable [duplicate]
I just wrote a function to fetch users from "reqres.in" with axios. I just cant save the data in my global variable but in the function with console.log everything is fine!
This is my code ...
1
vote
1
answer
100
views
Need to get data out of a Powershell Object after ConvertFrom-Json
I am doing an API call that is returning a json to my powershell script and is then run through the ConvertFrom-Json function to be a PS object. Some of the fields I'm able to access through $object....
2
votes
4
answers
95
views
Merge json objects into one
I'm trying to merge some json objects using jq.
It seems too complicated for me ^^
I have a JSON which looks like this
[
{
"name": "test_name",
"cpu": "1&...
0
votes
1
answer
94
views
How can I make new arrays for each respective element inside of my object which consists of four arrays total to dynamically generate a week forecast?
I am back again! I am almost done with the same project from which my most recent question is also derived. I have hit a huge bump in the road. Pretty much, I am trying to make a 7 day forecast ...
0
votes
4
answers
57
views
Advanced Filter array of objects based on condition if its nested object has required property in it
I am trying to solve a difficult computation but i am not reaching anywhere. can someone please help
Here is a simple example.
const filterCityBy = "NY";
const data = [
{ name: "...
0
votes
0
answers
23
views
How to loop through an object's keys and access information from each seperately [duplicate]
Each product key is nested with more objects. I can't seem to get an idea of how to get information from each product seperately.
The code below shows what i'm trying to do. I know that it doesn't ...
0
votes
2
answers
125
views
OpenEdge JSON with a extent propertry
I'm having trouble reading a JSON that has a extent[6] data property.
This is the JSON:
{
"SalesRep": [
{
"SalesRep": "BBB",
&...
0
votes
0
answers
39
views
UiPath : Read value as String from EventObjectIDType[]
I'm facing an issue to read a value from uipath workday - launch eib IntegrationEvent Output variable.
See attached image for variable type and the value i want to read is the "a428838...0000&...
0
votes
0
answers
26
views
Best practice instance objects - dictionary vs object
let's say I have a complexe object with hundrets of properties.
Is there a real downside using dictionaries instead of hierarchical objects?
In the past I used objects with complexe structure, but I ...
1
vote
0
answers
40
views
I want to display from date and to date on the frontend container from the json data
I have 4-5 containers in my html. Refer the sample code below.
<div class="mainContainer">
<div class="subContainer">
<%--<button id="testdata" ...
0
votes
0
answers
41
views
Cloned copy of object is still referenced, arrays within becomes mutable [duplicate]
I have an object which I would like to clone. I would like that the questionsObj always remains the same. In my project I build the questionsObj with a bunch of imports of arrays like this:
import ...
0
votes
1
answer
51
views
Retrieve one object from a list of objects, but not by index[], but by a name of a field [duplicate]
At the end you can find the classes and Json file.
How to retrieve one object from a list of objects, not by index[] but by a name of a field? I need to retrieve the full object.
After I deserialize a ...
0
votes
2
answers
77
views
Convert content to text parsing JSON URL response
I've got a url where the result is shown as below
"playerInfo": {
"059gh": {
"eligiblePos": "Flx3,G,Flx,Flx2,PG",
"...
0
votes
0
answers
47
views
MongoDB invalid character 'ÿ' looking for beginning of value
I am trying to add a database into mongodb atlas but the an error persist throughout all my json files. T
Full error message:
2023-10-22T16:48:08.867+0800 Failed: error processing
document #1: ...
0
votes
2
answers
66
views
Recurisve Object Transformation JS Utility - however nested values might be
i wish to make a utility function - which takes in an input - vanilla plain object - such that - it recursively traverses it to the deepest level even if a value is an array, it should iterate over ...
0
votes
0
answers
26
views
How can I get children in a tree map from MongoDB to show up as an array inside a children key
I'm trying to achieve an output that resembles JSON where children in a tree map show under an object's "children" key. The reason I'm asking is because I'm using Primefaces (PrimeVue) and ...
1
vote
1
answer
41
views
sum the value inside array of objects based on multiple conditions
I have this object
[
{
"year": 2020,
"term": 1,
"worthAmountEGP": 0
},
{
"year": 2020,
...
0
votes
1
answer
35
views
Merge array of objects based on overall key of object [duplicate]
I have this array of objects
var worksSummaryDetailsArr = [
{
year: 2020,
worksSummaryDetailsObj: [ [Object], [Object], [Object], [Object] ]
},
{
year: 2021,
...
0
votes
0
answers
20
views
PHP Deserialize JSON array and Get object name [duplicate]
how to get the object name? e.g: “XXX.HOSTNAME”
$json = '{
"XXX.HOSTNAME": {
"IP": "123.195.214.93",
"IP6": "",
"...
0
votes
2
answers
96
views
Js extract information from a json
I have the following json that is quite complex and detailed.
I need to extrapolate information (text) from the json only if the resource-id contains the following text "com.shazam.android:id/&...
0
votes
3
answers
88
views
PHP Get the value of every occurrence of a key in a multidimensional array
How would you extract every value of a key regardless of how deep or shallow it is in an array.
Here is a sample JSON array. I want to grab every occurrence of "content" and concatenate them ...
0
votes
0
answers
13
views
undefined to get nested obj [duplicate]
i have value name='dropshiper.name', i want to get error from this errors[name], but the output is undefined.
console.log(errors);
output:
{
"email": {
"type": "...
-3
votes
1
answer
64
views
How to store JSON data into an object after a fetch request?
I accessed a URL with a fetch request and do not know how to iterate through that data after fetching it.
Here is my code
var url = 'https://www.alphavantage.co/query?function=TIME_SERIES_DAILY&...
0
votes
1
answer
42
views
How can I access JSON nested obj to set state and display in React JSX?
I'm fetching a JSON object from my REST API @ "localhost:3001/customers/id" and trying to set it as state but I'm having trouble accessing my nested objects when trying to display the ...
-2
votes
2
answers
47
views
How can i change data format using with Javascript [closed]
{"Adana, Türkiye", "Mersin, Akdeniz/Mersin, Türkiye", "Yozgat, Yozgat Merkez/Yozgat, Türkiye"}
How can I convert this data format to array?
For example:
["Adana, ...
0
votes
1
answer
93
views
Having trouble accessing object data from JSON file in Gamemaker
I'm having an issue accessing JSON data for my game. Basically, I'm trying to pull this data in to use as dialogue. Here's the (relevant) snippet of JSON code below:
{
"actOne" : {
...
-1
votes
1
answer
57
views
How to add objects to list without having array brackets
I have a for loop in which I add some attributes to the object and at the end I need to have a string (to pass it as a query parameter)
I need
{"items":[{"itemsCode":"item1&...
0
votes
1
answer
154
views
Parsing/Fetching json in Android Studio Java
I want the Fetch Button to display/list only the values of a and b from the object 1
{ "1": {
"a": "a",
"b": "b",
"2": {"...