Comments (7)
I believe you've observed what you described; there's no obvious reason to think otherwise. But something quite strange is going on here. This library is a very small and simple one, being essentially just a specific JSON mapper. So if the result is not in the original REST response, it's very hard to believe that the library would manufacture one out of nothing. Furthermore, if the library is consistently misbehaving like this, all our current tests would fail. But all the tests pass before we push a release out. Therefore, the cause is much more likely to be somewhere else, for example, in the environment you are running in.
The code that you've pasted in above actually won't work with 0.9.0. You need the following type annotation to bring in a required implicit conversion
implicit val connection: Neo4jConnection = Neo4jREST()(wsclient)
This is actually my fault, as I didn't update README. I will do that right after this comment.
I would recommend running a separate neo4j-shell and verify that you don't have a rogue node created with the label anormcyphertest
that doesn't have a name
property.
from anormcypher.
Hi @Kai-Chen Sorry for late response.
I will try it again and more investigate further on this matter.
Thanks.
from anormcypher.
Hi @Kai-Chen So I tried that again and have the same issue. here is the exact code:
import org.anormcypher._
import play.api.libs.ws._
// Provide an instance of WSClient
val wsclient = ning.NingWSClient()
// Setup the Rest Client
// Need to add the Neo4jConnection type annotation so that the default
// Neo4jConnection -> Neo4jTransaction conversion is in the implicit scope
implicit val connection: Neo4jConnection = Neo4jREST(host = "docker", username = "neo4j", password = "admin")(wsclient)
// Provide an ExecutionContext
implicit val ec = scala.concurrent.ExecutionContext.global
// create some test nodes
Cypher("""create (anorm:anormcyphertest {name:"AnormCypher"}), (test:anormcyphertest {name:"Test"})""").execute()
// a simple query
val req = Cypher("match (n:anormcyphertest) return n.name")
// get a stream of results back
val stream = req()
// get the results and put them into a list
stream.map(row => {row[String]("n.name")}).foreach(println)
// remove the test nodes
Cypher("match (n:anormcyphertest) delete n")()
// shut down WSClient
wsclient.close()
I got the following this UnexpectedNullableFound(n.name) exception.
If I used row[Option[String]], it worked and got following output;
Some(AnormCypher)
None
Some(Test)
None
I also made sure the db is empty before running the code above.
I am running neo4j 3.0.0 if that helps.
Cheers
from anormcypher.
I am running neo4j 3.0.0 if that helps.
Well, that's the cause. Neo4j 3.0.x has changed the REST response at the transaction endpoint. We can probably add a fix to handle that. However, the 3.0.x release also has a binary driver. So for your use case, it might be easier just to use the Java driver. I'm not sure if it provides non-blocking streaming, which might be the only reason left to use anormcypher in preference over the binary.
from anormcypher.
This simple query response is easy to fix for anorm to work with Neo4j 3. But quite a few other tests are failing. So to completely support Neo4j 3 may take a while; we will do a patch release when it's done.
from anormcypher.
The new release 0.9.1 should support Neo4j 3.0.
Cheers!
from anormcypher.
Closing since there is no further comments in the past month.
from anormcypher.
Related Issues (20)
- Add Play 2.5 support HOT 2
- NoSuchMethodError with Play 2.5 HOT 21
- Generating Dynamic CQL in AnormCypher HOT 2
- Parse meta data returned from neo4j 3.0 tx endpoint
- Use macro to ensure that all code within the withTx block is executed sequentially HOT 1
- A number of the tests are failing with an exception HOT 5
- AnormCypher fails resolving dependencies HOT 5
- Neo4jREST.mapFormat doesn't support JsNull values HOT 5
- neo4j-jdbc HOT 3
- Async transaction support
- Cannot query data with neo4j 3.2.1 HOT 1
- initialCommands in console
- Query performance regressions since v0.7.1 HOT 2
- repo.anormcypher.org down HOT 3
- Clustering
- Release version for 2.12 HOT 1
- NingWSClient requires akka.stream.Materializer, and is deprecated
- Mirror packages on Maven Central HOT 1
- [email protected]
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from anormcypher.