如何在PDI中为mongodb输入步骤定义投影

如何在PDI中为mongodb输入步骤定义投影,mongodb,pdi,Mongodb,Pdi,以下是我在MongoDB中收集的文档的结构 { "_id": { "$oid": "5f48e358d43721376c397f53" }, "heading": "this is heading", "tags": ["tag1","tag2","tag3"],

以下是我在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字段(比如编写查询“selectid,headingfromcollection”)。投影条目不起作用,我在网上搜索后尝试了几种不同的方法。过滤、排序、分组工作正常,但投影不起作用。 如何在PDI中的Mongodb输入步骤中定义投影要从集合中选择某些字段,我已尝试在查询中指定投影,但它不起作用


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

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

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