Hi all,
So I have an Aura pro server and want to upload a block of JSON data we're generating up to it. My little Node app, whilst generating this JSON, holds it in state, so I figured it would be simple enough to use the JS driver to send that up to the server. The query works within the browser, using the same data and command, but I get:
Neo4jError: Invalid input '[': expected "+" or "-" (line 1, column 6 (offset: 5))
"WITH [object Object],[object Object], ...
by using either writeTransaction or run using the JS driver.
Is there an inherent issue with using a 'WITH' statement with the JS driver.
The statement looks like this:
const writeQuery = `WITH ${serviceMapJson} AS objects
UNWIND objects as service
call apoc.create.node([service.type],
{name:service.name, language:service.language, ... other fields listed})
yield node
return node`;
const writeResult = await session.writeTransaction((tx) => tx.run(writeQuery));
Is there a better way of doing this with static JSON? Aura seems to make it difficult to get JSON from a path since you can't upload to the server and things like pre-signed links in S3 don't work, so I went down this more direct route of passing the JSON in the query.
Also, I didn't want to have to iterate over the JSON object in the script and make several hundred individual create requests.
Any help appreciated, thanks.
p.s. Googling for 'WITH' statement Neo4j js driver is particularly problematic - 'with' being a fairly common word an' all :)