cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Problems encountered when using Noe4j 4.x http api to create apoc.create.vNode and return json

I used http api (Neo4j 3.5.x with apoc 3.5.x) to create apoc.create.vNode is able to return json format normally, the syntax is as follows:

{
"statements": [
{
"statement": "MATCH (n:Movie)-[r]-(x:Person) WHERE id(n) =$fn WITH n as jsx, n.title as fn CALL apoc.create.vNode(['country'],{name:fn}) yield node as a CALL apoc.create.vRelationship(jsx, 'relationship',{amount:1},a) yield rel return jsx,rel,a",
"parameters": {
"props": {
"fn": 95
}
},
"resultDataContents": [
"row",
"graph"
],
"includeStats": true
}
]
}

And the result json (part)

"graph": {
"nodes": [
{
"id": "-15",
"labels": [
"ai_country"
],
"properties": {
"a1_name": "The Birdcage"
}
},
{
"id": "95",
"labels": [
"Movie"
],
"properties": {
"tagline": "Come as you are",
"title": "The Birdcage",
"released": 1996
}
}
],
"relationships": [
{
"id": "-15",
"type": "relationship",
"startNode": "95",
"endNode": "-15",
"properties": {
"amount": 1
}
}
]
}

But when I upgraded to noe4j 4.x (with apoc 4.x), It isn't working, the result as follow (part)

"errors": [
{
"code": "Neo.ClientError.Statement.EntityNotFound",
"message": "Unable to load RELATIONSHIP with id -249."
}
]

But both Neo4j browser app (3.5.x, 4.x) use the same syntax and both work fine.
2X_a_a1f0f305f3d7d9a4e76d14dbaa25dc419305b53c.png

Do you have any suggestions?

2 REPLIES 2

ehume123
Node Clone

This could be an issue with the Cypher querying. Do you have any prior constraints set up in your working database before running into the error?

Thank you for reply.

I use bolt to get the data and then convert it to json format