README examples don't seem to be reflective of how Neo4J returns data
See original GitHub issueDetails
- Neo4j version: Community 4.0.6
- Neo4j Mode: Single instance (docker)
- Driver version: Javascript driver (running in Typescript) 4.1.0
- Operating system: PopOS (Ubuntu derivative) 20.04
Steps to reproduce
- Create node
import { types } from "neo4j-driver";
await session.run(
"CREATE (a:MyNode { name: $name, date: $date })",
{ name: "Bugsy Manode", date: types.DateTime.fromStandardDate(new Date()) }
);
- Try to retrieve node
const result = await session.run("MATCH (n:MyNode) RETURN n");
result.records.forEach((record) => {
console.log("Got me a node!", record.get("name")
});
Expected behaviour
Should see the following in the console:
Got me a node! Bugsy Manode
Actual behaviour
Get an error saying:
(node:55962) UnhandledPromiseRejectionWarning: Neo4jError: This record has no field with key 'name', available key are: [n].
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
RETURN - Cypher Manual - Neo4j
In the RETURN part of your query, you define which parts of the pattern you are interested in. It can be nodes, relationships,...
Read more >Welcome to the Dark Side: Neo4j Worst Practices (& How to ...
The Dark Side of Graph Data Modeling. Because graphs are schema-less, you might be tempted to ignore its design, to neglect documenting the ......
Read more >Filtering Query Results - Developer Guides - Neo4j
All of our examples will continue with the graph example we have been using in the previous guides, but include some more data...
Read more >Limiting MATCH results per row - Knowledge Base - Neo4j
Take an example case using the Movies database. If you needed a query to get all the ... The LIMIT will instead make...
Read more >Spring Data Neo4j
1, Spring Data Neo4j uses Spring Data Commons and its reflective ... define method parameters as already seen in the preceding examples.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@gfarrell Not sure if you mean that you want all nodes or all properties of a node. Your "“MATCH (n:MyNode) RETURN n” returns all nodes with label MyNode and the each node has it’s properties carried along with them so with this you get both.
node = record.get(0) name = node.properties[“name”]
Yes but instead of iterating from the values in the record you can as well iterate through the properties of the node