Skip to content

Commit

Permalink
add opt operator on CypherResult
Browse files Browse the repository at this point in the history
  • Loading branch information
andypetrella committed Sep 24, 2012
1 parent ca21bd1 commit 133b045
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/scala/be/nextlab/play/neo4j/rest/Neo4JElement.scala
Expand Up @@ -545,7 +545,8 @@ case class CypherResult(jsValue: JsObject) extends Neo4JElement {

lazy val transposedResultAsMap:Map[String, Seq[JsValue]] = columns zip data.transpose toMap

def apply(column:String) = transposedResultAsMap(column)
def apply(column:String):Seq[JsValue] = transposedResultAsMap(column)
def opt(column:String):Option[Seq[JsValue]] = transposedResultAsMap.get(column)
}

case class Failure(jsValue: JsObject, status: Int, info: String) extends Exception with Neo4JElement {
Expand Down

0 comments on commit 133b045

Please sign in to comment.