-
Notifications
You must be signed in to change notification settings - Fork 29
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
apoc.create.virtual.fromNode should wrap the existing node while keeping it's node-id and elementId but it doesn't #570
Comments
@jexp Do you want us in Cypher surface to look into this? In that case could you provide us with a setup so we can reproduce? |
you can test it on https://demo.neo4jlabs.com:7473/browser/ The original idea was to have an easy way to select which properties to return from a node to a client UI while keeping the functionality that you have when returning regular nodes. neo4j-contrib/neo4j-apoc-procedures#148 So wrapping a node .i.e. keeping it's identity and then limiting which properties are available. As I recently discovered the "keeping the identity" part was not implemented, so that the wrapped nodes are not tied to the original node or its relationships, which would have to be awkwardly reconstructed. Performance comparison for the query below, which returns roughly 34 nodes and 37 rels is 10 seconds vs 10ms for the approach excluding the huge properties.
Here is the example of how it should have worked:
and what you actually have to do now to make it work
|
@gem-neo4j did some digging for me and it seems like this was implemented with positive node ids earlier but changed because of a bug where changes to the virtual node were updating the real one: neo4j-contrib/neo4j-apoc-procedures#2252 |
Yeah but that was intentional that it is a wrapper of the real node so all operations on it should pass through. |
e.g.
apoc.create.virtual.fromNode(movie, ["title","released","url"])
returns virtual nodes with negative ids but it shouldn't in this case.
Seems like an implementation bug that somehow crept in.
Need it for excluding node embeddings and large text properties for returning in neo4j tools
The text was updated successfully, but these errors were encountered: