Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
03-19-2020 02:52 PM
Up to now,
I managed to have my function that run the queries being able to return a result immediately.
so the structure of my functions where
var session = driver.session();
return session.run([QUERY]).then(result=> return result.record.map ....)
I now have a bigger query and maybe for that reason, I end up having the query function return a Premise
I switched then to an async function with the following structure
var session = driver.session();
await session.run([QUERY]).then(result=> results= result.record.map ....)
return results
But then I get regeneratorRuntime is not defined at runtime in the console of the browser.
As environment config, I have the one of the sampe movies-javascript-bolt-master
Thank You
04-24-2020 06:02 AM
You cab do something like this
let query = 'query'
let param = {params }
try {
const result = await session.run(query, param)
if (result.records.length != 0) {
console.log('operation successful ')
} else {
console.log('operation did not return any result ')
}
} catch (error) {
console.log('exception occure', error)
throw error;
} finally {
await session.close()
}
All the sessions of the conference are now available online