【问题标题】:How to define Projection in PDI for mongodb input step [duplicate]如何在 PDI 中为 mongodb 输入步骤定义投影
【发布时间】:2020-11-13 06:34:10
【问题描述】:

以下是我在 MongoDB 集合中的文档结构

{
    "_id": {
        "$oid": "5f48e358d43721376c397f53"
    },
    "heading": "this is heading",
    "tags": ["tag1","tag2","tag3"],
    "categories": ["projA", "projectA2"],
    "content": ["This", "is", "the", "content", "of", "the", "document"],
    "timestamp": 1598612312.506219,
    "lang": "en"
}

我只想选择 IDheading 字段(例如编写查询“select id, heading from collection”)。投影条目不起作用,我在搜索互联网后尝试了几种不同的方法。过滤、排序、分组有效,但投影无效。 如何在 PDI 中的 Mongodb 输入步骤中定义投影以从集合中选择某些字段我已尝试在查询和 field expression 中指定投影,但它不起作用。

我在同一步骤中也遇到了麻烦concatenating string。因此,如果有人也可以帮助我,我将不胜感激。

【问题讨论】:

    标签: mongodb pdi


    【解决方案1】:

    通过像这样指定投影解决了这一步的问题

    [{$project: {heading: 1}}]
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-10-22
      • 1970-01-01
      • 2015-12-30
      • 2016-12-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多