Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

139
Views
JSON parse a property of an object inside an object?

I'm trying to JSON.parse(nodeInfluxSeries) a property that is in an object, that is also in an object and in an array. Like so:

 Array [
  Object {
    "id": 1,
    "properties": Object {
      "nodeInfluxSeries": "[{\"database\": \"boba\", \"fields\": [], \"measurement\": \"boba\", \"retentionPolicy\": \"boba\", \"tags\": {\"nodeId\": \"boba\"}}]",
      "series": "",
      "version": "",
    },
    "userRights": Object {
      "monitorManagement": true,
      "propertyEdit": Object {},
    },
  },
]

Tried something like this but it places a new property inside the first object.
note: random is the array

    random.map(r => {
      return {
        ...r,
        nodeInfluxSeries: JSON.parse(c.properties.nodeInfluxSeries),
      };
    })
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You need to nest the JSON.parse() inside the properties property of the result.

random.map(r => {
  return {
    ...r,
    properties: {
      ...r.properties,
      nodeInfluxSeries: JSON.parse(r.properties.nodeInfluxSeries)
    }
  };
})

You can also update the property in place instead of recreating all the objects:

random.forEach(r => r.properties.nodeInfluxSeries = JSON.parse(r.properties.nodeInfluxSeries));
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!