Open kunalj1994 opened 1 year ago
I have went through the code thoroughly and pinpointed two instances in the code where I think the bug could lie,
When running the createSingleRecord function
, since the input is a JSON it doesnt recognize it as a instance of Record, so it executes the corresponding if statement
which then executes this line
record = new Neo4j.types.Record(
record.keys,
fields.map(dumbToNeo4j),
(record as any)._fieldLookup,
)
This dumbToNeo4j function
looks to me as the culprit, because when running a regular query, the structure looks like this -
[
{
keys: ['n', 'r'],
length: 2,
_fields: [
{},{}
],
_fieldLookup: {
n: 0,
r: 1,
},
},
]
But when running the apoc.path.subgraph query
, the resulting structure looks like this -
[{
"keys": ["nodes", "relationships"],
"length": 2,
"_fields": [
[{}, {}],
[{}, {}]
],
"_fieldLookup": {
"nodes": 0,
"relationships": 1
}
}]
So this dumbToNeo4j
is unable to account for _fields
being a nested array and returns this result - {"keys":["nodes","relationships"],"length":2,"_fields":[null,null],"_fieldLookup":{"nodes":0,"relationships":1}}
It should account for fields in array, but maybe I forgot, Ill try to fix that, fun to have to do deseriallization myself as neo4j didn't wrote a seriallizinzation function
Perfect, thank you for your swift reply and looking into it.
Expected Behavior (Mandatory)
The visualization should update with the nodes and relationships from the response.
Actual Behavior (Mandatory)
Nothing happens, but the same query when executed with updateWithCypher function updates the visualization and shows the right nodes and relationships.
How to Reproduce the Problem
By using this query -
and capturing the result in a variable and passing it to updateWithFunction.
Simple Example
Specifications (Mandatory)
Currently used versions
Versions