Skip to content
This repository
Browse code

Saving to CouchDB doesn't fetch the documents 'id' property. Fixes #961.

Thanks to @hdeshev and @marianoguerra for analysis and the suggested fix.
  • Loading branch information...
commit 43c711edee61f36f592fd585a4945f48a206759f 1 parent 15b9103
Indrajit Raychaudhuri authored November 06, 2011
6  persistence/couchdb/src/main/scala/net/liftweb/couchdb/Database.scala
@@ -36,9 +36,9 @@ private[couchdb] object DatabaseHelpers {
36 36
   def handleUpdateResult(original: JObject)(json: JValue): Box[JObject] =
37 37
     for {
38 38
       obj <- Full(json).asA[JObject] ?~ ("update result is not a JObject: " + json)
39  
-      ok  <- Full(json \ "ok" ).asA[JField].map(_.value).asA[JBool].filter(_.value) ?~ ("ok not present in reply or not true: "+json)
40  
-      id  <- Full(json \ "id" ).asA[JField].map(_.value).asA[JString].map(_.s)    ?~ ("id not present or not a string: " + json)
41  
-      rev <- Full(json \ "rev").asA[JField].map(_.value).asA[JString].map(_.s)    ?~ ("rev not present or not a string: " + json)
  39
+      ok  <- Full(json \ "ok" ).asA[JBool].filter(_.value) ?~ ("ok not present in reply or not true: "+json)
  40
+      id  <- Full(json \ "id" ).asA[JString].map(_.s)    ?~ ("id not present or not a string: " + json)
  41
+      rev <- Full(json \ "rev").asA[JString].map(_.s)    ?~ ("rev not present or not a string: " + json)
42 42
     } yield updateIdAndRev(original, id, rev)
43 43
 }
44 44
 

2 notes on commit 43c711e

Mariano Guerra

thank you for applying the change!

Indrajit Raychaudhuri
Owner
Please sign in to comment.
Something went wrong with that request. Please try again.