RunMongoAggregation

Description:

A processor that runs an aggregation query whenever a flowfile is received.

Additional Details...

Tags:

mongo, aggregation, aggregate

Properties:

In the list below, the names of required properties appear in bold. Any other properties (not in bold) are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.

Display NameAPI NameDefault ValueAllowable ValuesDescription
Client Servicemongo-client-serviceController Service API:
MongoDBClientService
Implementation: MongoDBControllerService
If configured, this property will use the assigned client service for connection pooling.
Mongo URIMongo URIMongoURI, typically of the form: mongodb://host1[:port1][,host2[:port2],...]
Supports Expression Language: true (will be evaluated using variable registry only)
Mongo Database NameMongo Database NameThe name of the database to use
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Mongo Collection NameMongo Collection NameThe name of the collection to use
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
SSL Context Servicessl-context-serviceController Service API:
SSLContextService
Implementations: StandardSSLContextService
StandardRestrictedSSLContextService
The SSL Context Service used to provide client certificate information for TLS/SSL connections.
Client Authssl-client-authREQUIRED
  • WANT
  • REQUIRED
  • NONE
Client authentication policy when connecting to secure (TLS/SSL) cluster. Possible values are REQUIRED, WANT, NONE. This property is only used when an SSL Context has been defined and enabled.
Character Setmongo-charsetUTF-8Specifies the character set of the document data.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Querymongo-agg-queryThe aggregation query to be executed.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Allow Disk Useallow-disk-usefalse
  • true
  • false
Set this to true to enable writing data to temporary files to prevent exceeding the maximum memory use limit during aggregation pipeline staged when handling large datasets.
JSON Typejson-typeExtended JSON
  • Extended JSON Use MongoDB's "extended JSON". This is the JSON generated with toJson() on a MongoDB Document from the Java driver
  • Standard JSON Generate a JSON document that conforms to typical JSON conventions instead of Mongo-specific conventions.
By default, MongoDB's Java driver returns "extended JSON". Some of the features of this variant of JSON may cause problems for other JSON parsers that expect only standard JSON types and conventions. This configuration setting controls whether to use extended JSON or provide a clean view that conforms to standard JSON.
Query Output Attributemongo-query-attributeIf set, the query will be written to a specified attribute on the output flowfiles.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Batch SizeBatch Size100The number of elements returned from the server in one batch.
Results Per FlowFileresults-per-flowfile1How many results to put into a flowfile at once. The whole body will be treated as a JSON array of results.
Date Formatmongo-date-formatyyyy-MM-dd'T'HH:mm:ss'Z'The date format string to use for formatting Date fields that are returned from Mongo. It is only applied when the JSON output format is set to Standard JSON. Full documentation for format characters can be found here: https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
SSL Context Servicessl-context-serviceController Service API:
SSLContextService
Implementations: StandardSSLContextService
StandardRestrictedSSLContextService
The SSL Context Service used to provide client certificate information for TLS/SSL connections.
Client Authssl-client-authREQUIRED
  • WANT
  • REQUIRED
  • NONE
Client authentication policy when connecting to secure (TLS/SSL) cluster. Possible values are REQUIRED, WANT, NONE. This property is only used when an SSL Context has been defined and enabled.

Relationships:

NameDescription
resultsThe result set of the aggregation will be sent to this relationship.
failureThe input flowfile gets sent to this relationship when the query fails.
originalThe input flowfile gets sent to this relationship when the query succeeds.

Reads Attributes:

None specified.

Writes Attributes:

None specified.

State management:

This component does not store state.

Restricted:

This component is not restricted.

Input requirement:

This component allows an incoming relationship.

System Resource Considerations:

None specified.