You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@nifi.apache.org by Stéphane Maarek <st...@gmail.com> on 2016/05/27 02:58:15 UTC

How to use GetMongo Projection

Hi,

How do I construct a bson from the getMongo processor?
Basically, I want to retrieve field_1, field_2

Side note: I think your overall documentation is great, but it's missing
"example values". This will users figure out much more quickly what values
is expected from properties

Cheers
Stephane

Re: How to use GetMongo Projection

Posted by Joe Percivall <jo...@yahoo.com>.
Hello Stephane,

Sorry no one has responded to this yet. To get a project you can construct the BSON similar to how is done on this MongoDB page[1]. For example to retrieve only field_1 and field_2  you would use this as the value of the "projection" property "{ "field_1" : "1", "field_2" : "1"}".

As for example values, you can find many different example values in templates that use the processor you're interested in. You can find them in various places, a couple being:
https://cwiki.apache.org/confluence/display/NIFI/Example+Dataflow+Templates
https://github.com/hortonworks-gallery/nifi-templates

[1] https://docs.mongodb.com/manual/tutorial/project-fields-from-query-results/

 
Hope that helps,Joe
- - - - - - 
Joseph Percivall
linkedin.com/in/Percivall
e: joepercivall@yahoo.com



On Thursday, May 26, 2016 10:58 PM, Stéphane Maarek <st...@gmail.com> wrote:



Hi,

How do I construct a bson from the getMongo processor?
Basically, I want to retrieve field_1, field_2

Side note: I think your overall documentation is great, but it's missing "example values". This will users figure out much more quickly what values is expected from properties

Cheers
Stephane