Hi all,
Here is the simple explanation to my problem. Instead of this:
{ "foo" : "value" }
I need the value for foo to be output as follows:
{ "foo" : value }
Notice, there are no quotes around value. The reason I need this is because I am trying to generate JSON compatible with the mongo json parser to parse the JSON output and save it to a mongo database (). The mongo JSON parser expects dates in a very unusual format. So I wrote a MongoTimestampFormatter to output and parse dates in this unusual mongo-specific date format.
For example, instead of this:
{ "foo" = "2013-05-21T20:07:46Z" }
I need this:
{ "foo" = { $date: "2013-05-21T20:07:46Z" } }
The foo attribute is an NSTimestamp. However, the output from ERRest after using my MongoTimestampFormatter comes out as follows since ERRest puts quotes around the value and escapes any double quote characters in the middle:
{ "foo" = "{$date: \"2013-05-21T20:07:46Z\"}" }
Is there an easy solution to this problem?
Thank you
|