1

I am using Cassandra nodejs connector in loopback io framework. Since loopback do not have a inbuild cassandra connector I am using nodejs cassandra connector. Also I am using remotehook in loopback to call my custom method when calling a rest api. In the beforeremote() method i need to validate few inputs from api through my cassandra db tables.

I have 3 inputs keys in rest api which needs to be validated in cassandra 3 tables for which I have created 3 methods. The problem is I need to validate it one by one and I have asynchronous methods in cassandra. How can I achieve this in synchronous ways as all three validations should go one after the other in a synchrnous way. I can post code if need be.

Alex V
  • 1,155
  • 8
  • 10
Nipun
  • 4,119
  • 5
  • 47
  • 83

1 Answers1

2

For this purpose you can use async.series(). More details and example here: https://github.com/caolan/async#seriestasks-callback

Alex V
  • 1,155
  • 8
  • 10