Categories

Versions

You are viewing the RapidMiner Studio documentation for version 10.0 - Check here for latest version

Update MongoDB (NoSQL)

Synopsis

Updates one or more documents in a MongoDB collection.

Description

This operator updates one or more documents in the specified MongoDB collection. An update can thereby refer to the replacement of an document or to the modification of individual fields. The update consists of two parts: the query criteria to identify the document(s) and an update object that contains the new data.

The default update behavior of MongoDB is to replace entire documents. Special BSON operators are required to update individual fields. However, this operator tries to update individual fields by default to prevent data loss.

Input

  • criteria

    The JSON/BSON document to identify the document(s) to update.

  • update

    The JSON/BSON document containing the updated data. If using BSON operator such as "$set" ensure that the parameter "update individual fields" is disabled.

  • connection (Connection)

    This input port expects a Connection object if any. See the parameter connection entry for more information.

Output

  • criteria

    Pass through of the input criteria document (if any).

  • update

    Pass through of the input update document.

  • connection (Connection)

    This output port delivers the Connection object from the input port. If the input port is not connected the port delivers nothing.

Parameters

  • connection_source This parameter indicates how the connection should be specified. It gives you two options, predefined and repository. The parameter is not visible if the connection input port is connected. Range: selection
  • connection_entry This parameter is only available when the connection source parameter is set to repository. This parameter is used to specify a repository location that represents a connection entry. The connection can also be provided using the connection input port. Range: string
  • mongodb_instance This parameter is only available when the connection source parameter is set to predefined. The MongoDB instance to be used for storing the documents can be specified here. Range: configurable
  • write_concern The write concern which controls the acknowledgment of write operations by MongoDB. See MongoDB documentation for details. Range: selection
  • collection The MongoDB collection in which the documents are stored. Range: string
  • update_individual_fields If checked, the operator uses the MongoDB operator "$set" to update the fields of the provided update object without replacing other data. Otherwise, the operator simply replaces matching documents with the provided update document. Range: boolean
  • insert_unmatched_documents_(upsert) If checked, the operator adds the update document to the collection when no document matches the query criteria. Otherwise, the collections remains unchanged. Range: boolean
  • update_multiple_documents If checked, all documents that match the query criteria are updated. Otherwise, only the first match is updated. Range: boolean