Skip to main content

RunMongoAggregation

Description

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

Tags

aggregate, aggregation, mongo

Properties

In the list below required Properties are shown with an asterisk (*). Other properties 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:
MongoDBClientService

Implementations:
MongoDBControllerService
If configured, this property will use the assigned client service for connection pooling.
Mongo Database Name *Mongo Database NameThe name of the database to use

Supports Expression Language, using FlowFile attributes and Environment variables.
Mongo Collection Name *Mongo Collection NameThe name of the collection to use

Supports Expression Language, using FlowFile attributes and Environment variables.
Character Set *mongo-charsetUTF-8Specifies the character set of the document data.

Supports Expression Language, using FlowFile attributes and Environment variables.
Query *mongo-agg-queryThe aggregation query to be executed.

Supports Expression Language, using FlowFile attributes and Environment variables.
Allow Disk Use *allow-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 Type *json-typeExtended JSON
  • Extended JSON
  • Standard JSON
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, using FlowFile attributes and Environment variables.
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.

Supports Expression Language, using FlowFile attributes and Environment variables.

Dynamic Properties

This component does not support dynamic properties.

Relationships

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

Reads Attributes

This processor does not read attributes.

Writes Attributes

This processor does not write attributes.

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

This component does not specify system resource considerations.

See Also