const getIds = () => {
session
.run('MATCH (m :Movie) RETURN m.imdbId LIMIT 10')
.then(result => {
const ids = [];
result.records.forEach(record => ids.push(record._fields[0]));
return ids;
})
.catch(err => console.log(err));
}
const imdbIds = getIds();
console.log(imdbIds);
I want to get a list of movie IDs from my neo4j database but when I log my array to the console it says its undefined. P. S. I'm new to javascript.