【问题标题】:How to query in to Couchbase using node-red in post method?如何在 post 方法中使用 node-red 查询 Couchbase?
【发布时间】:2021-03-28 05:46:19
【问题描述】:

我正在尝试连接并运行查询,以使用 post 方法获取节点红色中的特定 id 值,但在查询中附加 post 数据时遇到问题。

通过以下方式尝试

API 请求流程

使用函数节点形成查询

表格后,查询我需要这样的查询格式

在哪里条件c.externalIds.customer_master in ['111','112','113'] 同样明智

但我得到了

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

我的帖子节点是

【问题讨论】:

    标签: node.js post couchbase node-red n1ql


    【解决方案1】:

    我在下面的查询中做了一些技巧

    1. 使用 array.join('","') 连接数组值

       ${msgNew.join('","')}
      
    2. 然后在附加和前置数组中打开和关闭符号

       [${msgNew.join('","')}]
      
    3. 现在我得到了预期的结果

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-03-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多