I have a JS Node.js query that does the computation for a single record.
const query1 = async(
{ eventBus, logger, neo4j },
{ account1, isValid },
messageOptions
) => {
let Start = {};
[Start] = await neo4j.readonlyConnection
.run(Query.getValue({ id: account1 }), 'query1');
if (!Start) {
throw new NotFoundError('Start not found');
}
return eventBus.producer
.sendMessage(MESSAGE_TYPES.CREATE, value, null, { ...messageOptions })
.catch(async(sendMessageError) => {
logger.warn(sendMessageError.message, sendMessageError);
await neo4j.run(Query.removeAccount(), 'remove-query')
.catch(logger.error);
});
};
const getValue = ({ id }) =>
QueryBuilder()
.matchNode('n', ['VALUE'], { id })
.return('n');
The above query works for a single input
[
{ "account1": "accountId1" },
]
Not sure how to modify the above query if it needs to be changed to JSON array.
[
{ "account1": "accountId1" },
{ "account2": "accountId2" },
]
Any leads would be appreciated