Search code examples
node.jspostcouchbasenode-redsql++

How to query in to Couchbase using node-red in post method?


I'm trying to connect and run the query to get particular id values in node-red using the post method but facing a problem in attaching post data in the query.

Tried in the following way

API request flow

enter image description here

Query forming using function node

enter image description here

After form, the query i need query formation like this

in where condition c.externalIds.customer_master in ['111','112','113'] like wise

but I'm getting

c.externalIds.customer_master in 111,112,113 like wise

and my post node is

enter image description here


Solution

  • I did some tricks in form the query like below

    1. Concatenated the array values using array.join('","')

       ${msgNew.join('","')}
      
    2. then in appended and prepended array open and close symbol

       [${msgNew.join('","')}]
      
    3. Now I got the result expected

    enter image description here