On 2 June 2011 00:56, Sujan Dutta <[email protected]> wrote:
>
> I am new to couchdb and i have a problem now
>
> well i have a date field which i am putting it as
>
> "createddate":"\\/Date(-684302343434)\\/"
>
> but it is storing in doc as
>
> "createddate":"/Date(-684302343434)/"
>
> how do i could solve this problem ?
>
Hi Sujan,
You are not escaping correctly. Also the date format seems unusual.
I think you wanted to have the final JSON like this:
{
"createddate": "Date(-684302343434)"
}
In which case, use -d '{"createddate":"Date(-684302343434)"}' instead.
the single quotes should be enough here, and escaping " needs to be
done \" not "\ or \\
It helps if you provide "what I did, what I expected, what I got" here.
Where does your date format come from? If you store a valid
javascript/JSON formatted date you can ask CouchDB to sort/filter on
this. Check out http://guide.couchdb.org/draft/views.html
Cheers
Dave