I'm using the Couchbase nodeJS SDK. To make a query I must call bucket.query("SELECT ...", function(err, rows){console.log("query's result received")})
I would like to run queries sequentially like :
- Run query A
- Work on result A
- Run query B
- Work on result B
- ...
- Continue after all results has been reveived and handle
Or even better it could be
- Run all queries
- Work on results one by one as they are being reveived
- Continue after all results has been reveived and handle
The point is I dont know how to wait for all the queries to be finished before continuing. I tought of promises but I'm new to nodeJS and I'm not sure I used them correctly, maybe someone could point me to the right direction ?
I saw that the async/await feature is available in node but I didn't manage to make it working either.
Any help would be apprecietate !
via MHogge
No comments:
Post a Comment