-
Notifications
You must be signed in to change notification settings - Fork 151
Aura example #594
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
Aura example #594
Conversation
This is how it'll look on the Aura connect page: I couldn't think of a better way to define the Bolt URL/User/Password so that they can use the Aura placeholders, so I've put them in comments that get removed when the code is pulled into Aura land. Happy to change that if there's a cleaner way to do it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks nice
test/examples.test.js
Outdated
const writeResult = await session.writeTransaction(tx => | ||
tx.run(writeQuery, { person1Name, person2Name }) | ||
) | ||
writeResult.records.forEach(row => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick, but record is perhaps clearer than row
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have updated row -> record
test/examples.test.js
Outdated
) | ||
writeResult.records.forEach(row => { | ||
console.log( | ||
`Created friendship between: ${row.get('p1').properties.name}, ${ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also nitpick, could be more clear if we use intermediate node variable
person1Node = row.get('p1')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense
await driver.close() | ||
// end::driver-introduction-example[] | ||
|
||
expect(await consoleLoggedMsg).toEqual( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this part isn't visible in Aura page?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeh, so it'll only include what's between these lines:
// tag::driver-introduction-example[]
and
// end::driver-introduction-example[]
This is how we pull in the samples on the Aura side:
include::https://raw.githubusercontent.com/mneedham/neo4j-javascript-driver/aura-example/test/examples.test.js[tag="driver-introduction-example-imports", indent=0]
include::https://raw.githubusercontent.com/mneedham/neo4j-javascript-driver/aura-example/test/examples.test.js[tag="driver-introduction-example-variables", indent=0]
include::https://raw.githubusercontent.com/mneedham/neo4j-javascript-driver/aura-example/test/examples.test.js[tag="driver-introduction-example", indent=0]
That's pointing at my branch at the moment, but I'll update it to use the official repo after it's merged.
No description provided.