Skip to content

Instantly share code, notes, and snippets.

@AmirHooshangi
Created December 15, 2014 19:59
Show Gist options
  • Save AmirHooshangi/c36fbce76cb73c12588a to your computer and use it in GitHub Desktop.
Save AmirHooshangi/c36fbce76cb73c12588a to your computer and use it in GitHub Desktop.
def exists(name: String): Boolean = {
val query = "start n=node(*) where has(n.name) AND n.name=" + "\""+ name + "\"" + " return n"
// val query = """start n=node(1) return n, n.name"""
var result = true
result = withTx { neo =>
val typedResult = query.execute.asCC[Test_Matrix]("n")
println("should return" + typedResult.toList.isEmpty)
if(typedResult.toList.isEmpty) {
false
}else {
true}
}
println("nobody comes here" + result)
result
}
##################################
should returnfalse
nobody comes herefalse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment