Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is the idea of how to read values values out of PackStreamStruct? #244

Closed
flq opened this issue Sep 25, 2017 · 7 comments
Closed

What is the idea of how to read values values out of PackStreamStruct? #244

flq opened this issue Sep 25, 2017 · 7 comments
Labels

Comments

@flq
Copy link

flq commented Sep 25, 2017

Consider the following statement:

MATCH (p:Person)-[r:OWNS]->(n) 
WITH p, collect(n) as products
WHERE id(p) = {id} RETURN p, products

Here the products key will point to a List<object> whose elements are Nodes, fair enough.

Now, suppose I also need relationship info and do something like this:

MATCH (p:Person)-[r:OWNS]->(n) 
WITH p, collect({ rel: r, product: n }) as products
WHERE id(p) = {id} RETURN p, products

What I now get is

((Dictionary<string,object>)((List<object>)result[0]["products"])[0]).Values
Count = 2
    [0]: {Neo4j.Driver.Internal.IO.PackStreamStruct}
    [1]: {Neo4j.Driver.Internal.IO.PackStreamStruct}

And here I cannot sensibly access the values of rel and product anymore because the value is represented with an internal object.

If you tell me that this is a fairly stable API I can drill holes into it to extract the values, but maybe you tell me that you will actually make those items public?

Looking forward to any pointers

@zhenlineo
Copy link
Contributor

PackStreamStruct should stay internal. We probably exposed the wrong type here. Working on a fix now.

Thanks so much for reporting to us!
Zhen

@zhenlineo zhenlineo added the bug label Sep 25, 2017
@flq
Copy link
Author

flq commented Sep 26, 2017

Thank you Zhen,
as an aside I was looking at whether I can put myself in the position to contribute since my current "pet" project involves knowing the .NET Neo Driver pretty well - running the integration & TCK(?) tests, it appears that you require access to some AWS resources...

Required environment variable is not defined: AWS_ACCESS_KEY_ID

However, the "Tests" project runs fine.

@zhenlineo
Copy link
Contributor

@flq Yeah, IT and TCK tests requires aws to download a server to run all tests unless you have already downloaded a server by running tests before. You could probably run most of IT and TCK tests if you have a community server in the path github-parent-folder/Target/neo4jhome, with password neo4j (See more in this class). But any ITs that has RoutingDriver or Cluster in its name still requires a enterprise server.

I will also fix this by allow a user to provide a file path to download server in boltkit later.

Be free to start a PR and send us a CLA, then your PR will be built by our build server.

@flq
Copy link
Author

flq commented Sep 27, 2017

Looks like the PR is merged, and it is already in the Nuget - I think that is nothing short of awesome, folkes. Thank you!
I should be able to give it a spin this evening and see how it behaves :)

@flq
Copy link
Author

flq commented Sep 27, 2017

Okay...um, color me confused. I look at the Driver code, it does not have PackStreamStruct anymore, I see that the code is tagged 1.5.0-rc1, as the nuget. I updated the nuget reference, removed older versions from the cache at %userprofile%\.nuget\packages - deleted obj, rebuilt...but I still get PackstreamStructs back with the opening cypher statement above.

Is the code not in the nuget yet?

@zhenlineo
Copy link
Contributor

Sorry, I messed up tags, rc1 has not got the fix in yet. It will come with rc2 very soon. See the changelog

If you would like to try it right now. You could play with our mygut feed to try out with a snapshot, see more info here

Zhen

@flq
Copy link
Author

flq commented Oct 2, 2017

I just tested with 1.5.0-rc2 and it is working as expected with nested nodes and relationships coming out as desired, or arbitrary values as a dictionary. From my point of view this could be closed.

Thank you very much, people 🥇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants