Coder Social home page Coder Social logo

Comments (4)

pontusmelke avatar pontusmelke commented on May 20, 2024

I am not sure I completely follow, if you don't need a full node object you should just return the things you need,

MATCH (n) RETURN id(n), n.prop1, n.prop2,...

or am I missing your point?

from neo4j-javascript-driver.

brian-gates avatar brian-gates commented on May 20, 2024

I've essentially done this. Here is my implementation:

return { __isNode: true, id: id(n), labels: labels(n), properties: { id: n.id, name: n.name } } as n

This works, but is quite a bit of extra work to re-implement the functionality one gets for free via a bonafide Node object. And I still have to manually reinstate the item's Nodeness based on what is returned.

I understand why a Node isn't returned. It's a hash. Who knows what's in it?

Perhaps map projections resolves this?

https://neo4j.com/blog/cypher-graphql-neo4j-3-1-preview/

from neo4j-javascript-driver.

pontusmelke avatar pontusmelke commented on May 20, 2024

Ok, now I understand what you mean. No currently there is no magic way of achieving this, we are working on better ways of serializing graph properties both on the server side and in the drivers. Map projections is one of these endeavors that might work for you but you will unfortunately have to wait for 3.1 for that one.

Regards,
Pontus

from neo4j-javascript-driver.

brian-gates avatar brian-gates commented on May 20, 2024

Yeah I figured. I'm guessing map projections won't even solve the issue, since I assume they return maps (given the name).

I think what we need is some way to "mask" the output. It sounds like a separate feature to map projections.

Anyway, I'll close the issue, especially since it sounds like it has nothing to do with this driver specifically.

from neo4j-javascript-driver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.