Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
07-24-2021 08:09 PM
Hello there
I'm trying to make a simple code like this one below work, but it doesn't.
Reactive session poorly documented in the JavaScript driver manual.
Here is the code:
function readTimebarDataReactive(entity,timebar) {
start = new Date().getTime();
session
.run(queryTemplates[entity])
.records()
.pipe(
map(record => record.get('item')),
concat(rxSession.close())
)
.subscribe({
next: data => {
timebar.merge(data)
console.log(data)
},
complete: () => {
timeElapsed('Completed', start)
timebar.zoom('fit', { animate: false })
},
error: err => console.log(err)
})
};
I tried it many times, always the same thing, the functions map and concat in the pipe function are not defined.
07-26-2021 01:49 AM
Hi,
Can you share the imports of your code?
Also, where do the variable session
and rxSession
come from? Why are they both used here?
07-26-2021 11:27 AM
Thanks @florent.biville1 for the quick answer
Here is all the files of my tiny code
The import sequence is in the index.html file.
index.html.txt (509 Bytes)
neo4j.js.txt (2.7 KB)
app.js.txt (2.6 KB)
I think map and concat functions are using a module i don't have, it's usually the case with a non-defined error.
All the sessions of the conference are now available online