-2

I am new to NodeJS so please excuse for this dumb question.

I receive a big JSON object in my NodeJS Service which I want to parse and make a new object which has some less properties from the original object. How can i do it in Node JS ?

Saif Kamaal
  • 192
  • 1
  • 9
  • 2
    Being new to programming is not a problem. Not doing any research is a problem. This question (probably with exactly the same title) has been asked before. Hundreds, if not thousands of times. – Tomalak Aug 09 '17 at 06:36
  • Possible duplicate of [Updating a JSON object using Javascript](https://stackoverflow.com/questions/8702474/updating-a-json-object-using-javascript) – baao Aug 09 '17 at 06:40
  • Start with a basic search for "parse JSON object", write some code based on that, then come back here when you have some code and you got stuck on one of your other points. We don't just write entire tutorials here for someone who shows no evidence of doing any homework or trying anything themselves. That's not what we're best at here. Do your research, try some things, then post when you code and a specific question about that code. – jfriend00 Aug 09 '17 at 06:57

1 Answers1

0

For example you got this object:

{
  "name": "Felix"
}

Just do:

const object = JSON.parse(thatObject);
// Then you will have access to that object key and values
console.log(object.name) // Felix
Felix Fong
  • 969
  • 1
  • 8
  • 21