---
title: "How to parse into JSON object using JSON.parse() in Node.js"  
description: "How to parse into JSON object using JSON.parse() in Node.js"  
author: "Anonymous User"  
published: 2013-04-02  
updated: 2013-04-02  
canonical: https://www.mindstick.com/forum/699/how-to-parse-into-json-object-using-json-parse-in-node-js  
category: "javascript"  
tags: ["javascript"]  
reading_time: 1 minute  

---

# How to parse into JSON object using JSON.parse() in Node.js

**Hi Guys**\
I am having the following [string object](https://www.mindstick.com/interview/2436/how-many-ways-we-can-create-the-string-object) and I want to create a [JSON object](https://www.mindstick.com/forum/160368/what-is-the-basic-structure-of-a-json-object) out of it and store it in MongoDB.\
var strMYDATA = '{"Name":"ABC","SignedDate" : ISODate("2013-04-02T09:07:42.282Z")}';I tried the following to create a JSON object out of strMYDATA\
var JSONobj = JSON.parse(strMYDATA); console.dir(JSONobj);Getting the following error:\
undefined:1 "Name":"ABC","SignedDate" : ISODate("2 ^[SyntaxError](https://www.mindstick.com/forum/159404/a-database-query-returns-a-syntaxerror): [Unexpected token](https://www.mindstick.com/forum/34353/error-messagesystem-queryexception-unexpected-token) I at Object.parse ([native](https://answers.mindstick.com/qa/43346/what-did-almost-all-native-american-societies-have-in-common-in-the-1400s))Could [anyone](https://www.mindstick.com/articles/23207/how-to-find-the-best-fit-job-for-anyone) know how to parse the string with ISO date field like above in [Node.JS](https://www.mindstick.com/articles/1499/upload-and-download-file-in-node-js)?\
**Note**: Cannot change the strMYDATA [content](https://www.mindstick.com/articles/13019/get-the-best-content-marketing-pricing-packages-for-your-brand) because it a serialized object received from other Node.JS [restful API](https://www.mindstick.com/articles/335974/retrieve-data-from-restful-api-and-add-paging-in-knockout-js).\
**Thanks**\

## Replies

### Reply by AVADHESH PATEL

Hi Pravesh!\
Your JSON data is bad. You have unescaped strings in your data.\
var strMYDATA = '{"Name":"ABC","SignedDate" : "ISODate("2013-04-02T09:07:42.282Z")"}';\
should be\
var strMYDATA = '{"Name":"ABC","SignedDate" : "ISODate(\"2013-04-02T09:07:42.282Z\")"}';


---

Original Source: https://www.mindstick.com/forum/699/how-to-parse-into-json-object-using-json-parse-in-node-js

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
