Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

94
Views
Modify query to accept JSON array

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

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!