Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
09-21-2018 05:00 AM
neo4j version 3.4.0
The gps node contains three attributes:
coordinates: point
location: string
type: string
eg: coordinates: point({srid:4326, x:30.655691, y:104.081602}) ,location: shanghai ,type: gps
I encountered an error while querying:
curl http://IP:PORT/db/data/transaction/commit -u xxxx:xxxx -H "Content-Type: application/json"
-d "{
"statements": [{
"statement": "match (n:gps) return n",
"parameters": {},
"includeStats": true,
"resultDataContents": ["rest"]
}]
}
"
Error is as follows: "code": "Neo.TransientError.Network.CommunicationError", "message": "Current context not an ARRAY but OBJECT", "stackTrace": "org.codehaus.jackson.JsonGenerationException: Current context not an ARRAY but OBJECT
But the following procedure was successful
curl http://IP:PORT/db/data/transaction/commit -u xxxx:xxxx -H "Content-Type: application/json"
-d "{
"statements": [{
"statement": "match (n:gps) return n.coordinates,n.type,n.loacation",
"parameters": {},
"includeStats": true,
"resultDataContents": ["rest"]
}]
}
"
09-21-2018 01:25 PM
It looks like demarshalling a coordinate doesn't work on the http endpoint. You can either switch to use bolt - which is anyway recommended over http. The other workaround would be not to return the geo property and instead return explicitly there x,y and z coordinates directly as numbers.
09-25-2018 11:30 PM
Unfortunately, bolt - which does not support point property
09-26-2018 01:34 AM
Not 100% sure, but I guess the latest versions of the bolt drivers should treat locations as first class citizens.
All the sessions of the conference are now available online