Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
@indrajitr indrajitr authored
View
6 persistence/couchdb/src/main/scala/net/liftweb/couchdb/Database.scala
@@ -36,9 +36,9 @@ private[couchdb] object DatabaseHelpers {
def handleUpdateResult(original: JObject)(json: JValue): Box[JObject] =
for {
obj <- Full(json).asA[JObject] ?~ ("update result is not a JObject: " + json)
- ok <- Full(json \ "ok" ).asA[JField].map(_.value).asA[JBool].filter(_.value) ?~ ("ok not present in reply or not true: "+json)
- id <- Full(json \ "id" ).asA[JField].map(_.value).asA[JString].map(_.s) ?~ ("id not present or not a string: " + json)
- rev <- Full(json \ "rev").asA[JField].map(_.value).asA[JString].map(_.s) ?~ ("rev not present or not a string: " + json)
+ ok <- Full(json \ "ok" ).asA[JBool].filter(_.value) ?~ ("ok not present in reply or not true: "+json)
+ id <- Full(json \ "id" ).asA[JString].map(_.s) ?~ ("id not present or not a string: " + json)
+ rev <- Full(json \ "rev").asA[JString].map(_.s) ?~ ("rev not present or not a string: " + json)
} yield updateIdAndRev(original, id, rev)
}

2 comments on commit 43c711e

@marianoguerra

thank you for applying the change!

@indrajitr
Owner
Please sign in to comment.
Something went wrong with that request. Please try again.