0

Following is the structure of the document i have in a collection in 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"
}

I only want to select ID and heading fields (like writing query "select id, heading from collection"). the projection entries are not working, I have tried a few different approaches after searching the internet. Filtering, sorting, grouping is working but projection is not. How do i define projection in Mongodb input step in PDI to select certain fields from a collection I have tried specifying projection in query and field expression but it is not working.

Also i am having trouble concatenating string in the same step. so i would appreciate if someone can help me with that as well.

ghengalala
  • 109
  • 9

1 Answers1

0

solved the problem in this step by specifying projection like this

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

ghengalala
  • 109
  • 9