Basically, there's a few places where CouchDB will give you "id" and "rev" instead of "_id" and "_rev". You will have to special-case those.
Also, this question should be on the [email protected] mailing list. You can subscribe to that from the couchdb website. Wout. On Jun 23, 2010, at 9:32 , adyut wrote: > Hi everybody, > > any guidance for this from anybody!!!! > > > Thanks > Adyut > > On Jun 21, 3:19 pm, adyut <[email protected]> wrote: >> Hi all, >> >> I am very new to the CouchDB and really liked the idea. While I was >> trying to use it I found this, when I fire an URL (RESTUrl) to create >> a doc -- >> URL :: PUT http://127.0.0.1:5984/my_first_db/four >> >> OUTPUT :: >> {"ok":true,"id":"four","rev":"1-967a00dff5e02add41819138abb3284d"} >> >> it's created successfully then I tried to access it >> URL :: GET http://127.0.0.1:5984/my_first_db/four >> >> OUTPUT :: {"_id":"four","_rev":"1-967a00dff5e02add41819138abb3284d"} >> >> I got the data.... and problem is, please notice the keys in output in >> both cases. In first keys "id" and "rev " are without underscore >> "_",and while accessing they came with an underscore. In my project I >> am using a global variable initialized with say"_rev" and using it >> everywhere in project. This is an issue for me because I have >> requirement where first I am checking whether doc is exist or not if >> not create one and use it. Now I have two options >> 1)creating to 2 global variables ....... OR >> 2)Fire GET immediately after PUT.... >> >> Is there any other better way to handle the situation... If the >> question is already answered please give me the pointer to the answer. >> >> Thanks in advance >> Adyut
