GetMongo

Description:

Creates FlowFiles from documents in MongoDB loaded by a user-specified query.

Additional Details...

Tags:

mongodb, read, get

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: StandardRestrictedSSLContextService
StandardSSLContextService
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.
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.
Pretty Print Results JSONuse-pretty-printingTrue
  • True
  • False
Choose whether or not to pretty print the JSON from the results of the query. Choosing 'True' can greatly increase the space requirements on disk depending on the complexity of the JSON document
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)
QueryQueryThe selection criteria to do the lookup. If the field is left blank, it will look for input from an incoming connection from another processor to provide the query as a valid JSON document inside of the FlowFile's body. If this field is left blank and a timer is enabled instead of an incoming connection, that will result in a full collection fetch using a "{}" query.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
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)
ProjectionProjectionThe fields to be returned from the documents in the result set; must be a valid BSON document
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
SortSortThe fields by which to sort; must be a valid BSON document
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
LimitLimitThe maximum number of elements to return
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Batch SizeBatch SizeThe number of elements to be returned from the server in one batch
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Results Per FlowFileresults-per-flowfileHow many results to put into a FlowFile at once. The whole body will be treated as a JSON array of results.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
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: StandardRestrictedSSLContextService
StandardSSLContextService
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.
Send Empty Resultget-mongo-send-emptyfalse
  • true
  • false
If a query executes successfully, but returns no results, send an empty JSON document signifying no result.

Relationships:

NameDescription
successAll FlowFiles that have the results of a successful query execution go here.
failureAll input FlowFiles that are part of a failed query execution go here.
originalAll input FlowFiles that are part of a successful query execution go here.

Reads Attributes:

None specified.

Writes Attributes:

NameDescription
mongo.database.nameThe database where the results came from.
mongo.collection.nameThe collection where the results came from.

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.