Update for MongoDB - Data360_Analyze - Latest

Data360 Analyze Server Help

Product type
Software
Portfolio
Verify
Product family
Data360
Product
Data360 Analyze
Version
Latest
Language
English
Product name
Data360 Analyze
Title
Data360 Analyze Server Help
Copyright
2024
First publish date
2016
Last updated
2024-11-28
Published on
2024-11-28T15:26:57.181000

Performs updates and deletions to documents within a MongoDB database.

The node accepts a "document" containing query criteria, and a document that defines the modifications that are to be made to the document(s) in the MongoDB "collection" that match the query.

You can use the UpdateQuery and UpdateDocument properties to specify the document containing the query criteria and the document containing the modifications. You can point to the documents in a number of ways:

  • Specify a literal value - use the from Data variant of the property.
  • Specify the name of an input field that contains the document - use the from Data Field variant of the property.
  • Specify the path to a file containing the document - use the from Filename variant of the property.
  • Specify the name of an input field that contains the path to the file - use the from Filename Field variant of the property.

There are multiple ways to configure the node, for example you can create a new document if there are no matching documents (Upsert operation), update one or multiple matching documents, or delete matching documents.

See:

Properties

UpdateQuery

Optionally specify a MongoDB query that defines the selection criteria for the update.

In this property, enter only the information that you would pass as a parameter to the find() method in the MongoDB shell e.g.

<property value> in the following example:

db.collection.find( <property_value> )

Only documents selected by the query will be updated.

See the MongoDB documentation for more information: http://docs.mongodb.org/manual/core/read/

  • Choose the (from Data) variant of this property to specify the query document itself.
  • Choose the (from Data Field) variant of this property to specify the name of the field on the input pin containing the query document.
  • Choose the (from Filename) variant of this property to specify the path of the file containing the query document.
  • Choose the (from Filename Field) variant of this property to specify the name of the field on the input pin that defines the path of the file containing the query document.

UpdateDocument

Optionally specify a MongoDB document that defines the modifications to be made on the documents selected from the UpdateQuery property.

  • Choose the (from Data) variant of this property to specify the update document itself.
  • Choose the (from Data Field) variant of this property to specify the name of the field on the input pin containing the update document.
  • Choose the (from Filename) variant of this property to specify the path of the file containing the update document.
  • Choose the (from Filename Field) variant of this property to specify the name of the field on the input pin that defines the path of the file containing the update document.

Collection

Specify the MongoDB collection on which to perform the query.

Choose the (from Field) variant of this property to look up the value from an input field with the name specified.

A value is required for this property.

Server

Optionally specify the server to connect to.

The default value is 'localhost'.

Port

Optionally specify the port on which the server is running.

The default value is 27017.

Username

Optionally specify the database username.

Password

Optionally specify the database password.

Database

Specify the database name.

A value is required for this property.

AuthDatabase

Optionally specify the authorization database name.

If unset it will default to "admin".

Upsert

Optionally specify whether to create a new document if no document matches the UpdateQuery criteria.

  • When set to true, an existing document will be updated, or, if no match is found, a new document is inserted.
  • When set to false, no document is inserted if no match is found.

The default value is True.

MultipleUpdates

Optionally specify whether to update multiple documents that meet the UpdateQuery criteria.

  • When set to true, all documents that match the criteria are updated.
  • When set to false, only one document that matches the criteria is updated.

The default value is False.

WriteMode

Optionally specify the mode of operation.

  • When set to Update, the node will either update existing documents or insert new documents into the specified collection.
  • When set to Remove, the node will delete all documents that match the match the UpdateQuery criteria.

The default value is Update.

WriteConcern

Optionally specify how to synchronize updates and deletions with the MongoDB server.

  • When set to Acknowledged, updates/deletions will wait for acknowledgement from the MongoDB server before returning.
  • When set to Unacknowledged, updates/deletions will return as soon as the message is written to the MongoDB server socket. In this mode, errors from the operation will not be caught.

The default value is Acknowledged.

ClearCollection

Optionally specify whether, for each collection updated, all existing documents are removed before the first update.

Only applicable when WriteMode is Update.

The default value is False.

CreateCollection

Optionally specify whether to create a new collection when updating if the specified collection does not already exist.

If set to false the node will error if an attempt is made to update a non-existent collection.

The default value is False.

SSL

Optionally specify whether communication with the database will be made with an SSL connection.

The MongoDB server must support SSL if this is set to true.

The default value is False.

OutputWriteResult

Optionally specify whether to output the result returned from the server on completion of the update.

This is only applicable when the node has an input pin.

If the WriteConcern property is set to Unacknowledged, the write result will always be N/A.

The default value is False.

PassThroughFields

Optionally specify which input fields will "pass through" the node unchanged from the input to the output, assuming that the input exists. The input fields specified will appear on those output records which were produced as a result of the input fields. Choose from:

  • All - Passes through all the input data fields to the output.
  • None - Passes none of the input data fields to the output; as such, only the fields created by the node appear on the output.
  • Used - Passes through all the fields that the node used to create the output. Used fields include any input field referenced by a property, be it explicitly (i.e., via a 'field1' reference) or via a field pattern (i.e., '1:foo*').
  • Unused - Passes through all the fields that the node did not use to create the output.

The default value is Used.

If a naming conflict exists between a pass-through field and an explicitly named output field, an error will occur.

AllowBackslashEscapingAnyCharacter

Optionally specify whether to quote all characters using backslash quoting mechanism: if not enabled, only characters that are explicitly listed by JSON specification can be thus escaped (see JSON spec for small list of these characters)

The default value is False.

AllowNonNumericNumbers

Optionally specify whether parser should recognize set of "Not-a-Number" (NaN) tokens as legal floating number values (similar to how many other data formats and programming language source code allows it).

The default value is False.

AllowNumericLeadingZeros

Optionally specify whether parser will allow JSON integral numbers to start with additional (ignorable) zeroes (like: 000001).

The default value is False.

AllowSingleQuotes

Optionally specify whether parser will allow use of single quotes (apostrophe, character '\'') for quoting Strings (names and String values).

The default value is False.

AllowUnquotedControlChars

Optionally specify whether parser will allow JSON Strings to contain unquoted control characters (ASCII characters with value less than 32, including tab and line feed characters) or not.

The default value is False.

AllowUnquotedFieldNames

Optionally specify whether parser will allow use of unquoted field names (which is allowed by JavaScript, but not by JSON specification).

The default value is True.

ErrorThreshold

Optionally specify the number of transfer errors that will cause the node to give up and fail.

Each record on the input pin is a "request". A transfer error is any error that causes a request to fail (e.g. a requested file does not exist). Setting this property instructs the node to continue processing requests as long as the number of errors remains below the given threshold.

An ErrorThreshold of 0 means never fail on a transfer error (the node will still fail on more serious errors).

The default value is 1; the node fails on the first error encountered.

NullDataBehavior

Optionally specify the behavior of the node when the node is processing data from an input pin, and the data is null. Choose from:

  • Error
  • Log
  • Ignore

The default value is Ignore.

Note that this only has affect when there is an input to the node, and the DataSource is set to be a Filename Field or Data Field, and the specified field is null for a given record.

LogConfig

The optional LogConfig property is rarely given a value. By default, the JavaNode creates a parsable (i.e., xml) log in the usual place, namely the directory ({{^logTempDir^}} /user/data flow/run_name/. Its logging threshold is set by the LogLevel property.

Customization of JavaNode logging is achieved by specifying an XML text value for the LogConfig property. You can create multiple logs, each of which filters log events by LogLevel and/or ErrorCode or some other user-defined logic supplied as a Java class. A log can also subscribe to events generated by another log.

For more information, see Java node configuration.

Inputs and outputs

Inputs: 1 optional.

Outputs: Data, Errors.