-
Notifications
You must be signed in to change notification settings - Fork 150
Feature Request for a toJSON method #189
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
Comments
Hi @joefraley, There is a method called |
Hi @joefraley, Thanks for raising this issue. What do you think about the solution suggested/added by @legraphista? |
Yeah, that's the idea. Are you open to making the method return a promise instead? A record could be pretty large. I'm thinking of the browser API fetch, whose response object has a json() method that does basically the same thing. |
@joefraley method |
That makes sense, I guess the value unwrapping would always happen in a promise chain anyway (after |
Actually I tried using your toObject as is and it could benefit from some refinement for easy use still. Basically for easy objectifying we want the keys and _fields array zipped together so that
becomes the standard form maybe there is a way to get closer to this kind of thing already? I am just learning neo4j and cypher now. |
Hi @sean-stanley, I think you can achieve this using aliases in Cypher. Hope this helps. |
Hey @sean-stanley our colleague @oskarhane provided such a function in this demo: |
@sean-stanley that's exactly what I expected actually, I haven't tried the method yet. @lutovich I haven't run into any case where I would rather If you did |
Actually it does behave as expected my bad. I setup a sample case incorrectly. Using the n.name as name method also works well. It's a bit annoying when you need half a dozen fields to do that but for the simple queries it worked well. |
So far I find this pattern pretty frustrating:
I'm sure there are lots of use cases for all of that other machinery on the response, but a quick "just give me some json that looks like my data" method would be sublimely convenient.
The text was updated successfully, but these errors were encountered: