Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
10-29-2019 11:27 AM
Hi! I have written a node js app.
This approach being used to write/read data from DB:
async function startQuery(query) {
const session = driver.session();
return session
.run(q)
.then(result => {
session.close();
return result;
})
.catch(error => {
session.close();
});
}
I usually use async/await in code.
What about this way? Or better to use writeTransaction and readTransaction with txc (without async txc)?
async function newQ(query) {
const session = driver.session();
const write = session.writeTransaction(async txc => {
var result = await txc.
return result;
});
write
.then(namesArray => {
console.log(namesArray);
})
.catch(error => {
console.log(error);
})
.then(() => session.close());
}
All the sessions of the conference are now available online