I am storing the data in the mongo table as JSON format using Nodejs and mongoskin. Mongo automatically adding the slashes in the json formatted data. Then when i retrieving, i can not able to parse the data. Please suggest me, How do i remove the slashes or how do i parse the data?
db.messagetable.find().forEach(printjson)
{
"_id" : "1861574",
"MatriId" : "1861574",
"session" : "{\"messages\":{\"cometchat\":{\"timedifference\":0,\"cometchat_buddytime\":0,\"msgavails\":\"\"}}}",
"expires" : 1341702134
}
here slahses are used to escape the charatcer
"in your JSON encoded string(not a json object becauseso the keys must be enclosed with
"to represent a string, but you cannot just put"inside the string. To fix that json parsers append the\so when you parse, just call the
JSON.Parseon the session string