Snap Functions and Properties

Snap Functions and Properties

In this Page

label

Description

The label of the Snap.

Syntax

snap.label

Example

Expression: snap.label

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

instanceId

Description

The 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

Description

The 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:

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

Description

The 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

Description

The 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

Description

The 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

Description

The 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()

Description

Loads 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

Description

The 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.