Skip to end of banner
Go to start of banner

MongoDB - Insert

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

 

Snap type:

Write

 

Description:

This Snap executes a MongoDB insert command. Input documents will be inserted into the database. DateTime objects will be converted to UTC time zone by MongoDB, so the original timezone will be lost when inserting the object.

 

Prerequisites:

[None]

 

Support and limitations:
  • Ultra pipelines: Supported in Ultra Pipelines if batch size is set to 1.
  • Spark mode (Deprecated): Not supported in Spark mode.

 

Account: 

This Snap uses account references created on the Accounts page of SnapLogic Manager to handle access to this endpoint. See MongoDB Account for information on setting up this type of account.

 

Views:
InputThis Snap has exactly one document input view. The input document will be inserted into the database.
Output

This Snap has no output view.

As of the 4.5 release, this Snap has at most on document output view.

ErrorThis Snap has at most one document error view and produces zero or more documents in the view.

Settings

Label

 

Required. The name for the Snap. You can modify this to be more specific, especially if you have more than one of the same Snap in your pipeline.
Database name

The database that the collection is defined in. If not specified, then the MongoDB account database will be used.

Example: assets
Default value: [None]
 

Collection name


 

Required. MongoDB collection name to execute insert on.

Example: users
Default value: [None]
 

Batch Size

Required. Number of documents to be inserted at a time.

Example: 10
Default value:  1

 

Pass through

If selected, the input document will be passed through to the output views under the key 'original'. The document will be passed to the Parameter output view, and it will also be passed to the Result Set output view if there is output sent from this view.

Default value:  Selected

Execute during preview


This property enables you to execute the Snap during the Save operation so that the output view can produce the preview data.

Default value : Not selected

 

 

The upstream schema suggest is only supported if the defined collection provides data. MongoDB does not provide a metadata API to describe the collection, so the SnapLogic platform looks at the data and derives the schema from it.  


Example 


In this example, the documents are inserted into a collection using the MongoDB Insert Snap. The documents are passed using the upstream JSON Generator Snap and the Mapper Snap respectively.

 

The JSON Generator Snap passes the documents to be inserted into the MongoDB collection.

 

 

The Mapper Snap maps the input documents to the database collection.

 

 

The MongoDB Insert Snap inserts the documents into the collection 'test collection'.

 

 

The successful execution of the pipeline displays the below output preview:

 

 

Snap History

4.9.0

  • Updated the Snap with Database name property to support the users defined in an authentication database.

September 2013

  • This Snap was introduced in this release.
  • No labels