Snap Functions and Properties

In this Page

label

DescriptionThe label of the Snap.
Syntax
snap.label
Example

Expression: snap.label

Result: Mapper+%28Data%29 for Mapper (Data)

instanceId

DescriptionThe UUID of the Snap (not the runtime UUID of the Pipeline, which is different).
Syntax
snap.instanceId
Example

Expression: snap.instanceId

Result: The alphanumeric ID for the Snap in the form of xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

inputViews

DescriptionThe input view names and number of documents that have been read from these views.
Syntax
snap.inputViews
Example

Expression: snap.inputViews

Result:

  • If no view is defined, it returns {}.

  • For each view defined, it returns:

"Target": {
      "input_name": {
        "count": n,
        "name": "input_name"
      }

 where:

    • "Target" is the name of the target path this expression is mapping to.
    • "input_name" is the name of the input view
    • n is the number of documents that have been read

outputViews

Description

The output view names and number of documents that have been written to these views.

Syntax
snap.outputViews
Example

Expression: snap.outputViews

Result:

  • If no view is defined, it returns {}.
  • For each view defined, it returns:
"Target": {
      "output_name": {
        "count": n,
        "name": "output_name"
      }

where:

  • "Target" is the name of the target path this expression is mapping to.
  • "output_name" is the name of the output view
  • n is the number of documents that have been read

errorViews

DescriptionThe error view and number of documents that have been written to this view.
Syntax
snap.errorViews
Example

Expression: snap.errorViews

Result: For each view defined, it returns:

"Target": {
      "error0": {
        "count": n,
        "name": "error0"
      }

where:

  • "Target" is the name of the target path this expression is mapping to.
  • "error0" is the name of the error view
  • n is the number of documents that have been read

in.totalCount

DescriptionThe total number of documents that have passed through all of the Snap's input views.
Syntax
snap.in.totalCount
Example

Expression: snap.in.totalCount

Result: The number of documents.

out.totalCount

DescriptionThe total number of documents that have passed through all of the Snap's output views.
Syntax
snap.out.totalCount
Example

Expression: snap.out.totalCount

Result: The number of documents.

error.totalCount

DescriptionThe total number of documents that have passed through all of the Snap's error views.
Syntax
snap.error.totalCount
Example

Expression: snap.error.totalCount

Result: The number of error documents

original.load()

DescriptionLoads the original message (document) coming to the FeedMaster when using an Ultra pipeline. This expression is usable only in Snaps inside an Ultra Pipeline.
Syntax
snap.original.load()
Example

Expressionsnap.original.load()

Result: The original content of the document, along with the entire request sent to the feedmaster.

original.id

DescriptionThe unique ID associated with the message (document) coming into the Ultra pipeline. This expression is usable only in Snaps inside an Ultra Pipeline.
Syntax
snap.original.id
Example

Expressionsnap.original.id

Result: Unique ID of the message of type String.