Neo4j Bulk Insert gets the same UUID value / gets the same return value.
createAlbumAndTracks(album:any, tracks:any[]):any {
const query = `
UNWIND {trackList} as track
MERGE (a:Albums ${insertQuery(album)})
CREATE (t:Tracks)
SET
t = track,
t.id = '${uuid()}',
t.created = timestamp()
MERGE (a)-[r:ALBUM_TRACKS]->(t)
RETURN t`;
return db.run(query, Object.assign(album, {trackList: tracks}));
}
t.id = '$ {uuid ()}' gets the same value, although it must have a unique UUID. How to call a function every time you create a new node?
source
share