turcsanyip commented on a change in pull request #5482:
URL: https://github.com/apache/nifi/pull/5482#discussion_r746732253



##########
File path: 
nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/PutMongoRecord.java
##########
@@ -39,46 +48,99 @@
 import org.apache.nifi.serialization.record.RecordSchema;
 import org.apache.nifi.serialization.record.util.DataTypeUtils;
 import org.bson.Document;
+import org.bson.conversions.Bson;
 
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashSet;
+import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
 @EventDriven
-@Tags({"mongodb", "insert", "record", "put"})
+@Tags({"mongodb", "insert", "update", "upsert", "record", "put"})
 @InputRequirement(InputRequirement.Requirement.INPUT_REQUIRED)
-@CapabilityDescription("This processor is a record-aware processor for 
inserting data into MongoDB. It uses a configured record reader and " +
-        "schema to read an incoming record set from the body of a flowfile and 
then inserts batches of those records into " +
-        "a configured MongoDB collection. This processor does not support 
updates, deletes or upserts. The number of documents to insert at a time is 
controlled " +
-        "by the \"Insert Batch Size\" configuration property. This value 
should be set to a reasonable size to ensure " +
-        "that MongoDB is not overloaded with too many inserts at once.")
+@CapabilityDescription("This processor is a record-aware processor for 
inserting/upserting data into MongoDB. It uses a configured record reader and " 
+
+        "schema to read an incoming record set from the body of a flowfile and 
then inserts/upserts batches of those records into " +
+        "a configured MongoDB collection. This processor does not support 
deletes. The number of documents to insert/upsert at a time is controlled " +
+        "by the \"Batch Size\" configuration property. This value should be 
set to a reasonable size to ensure " +
+        "that MongoDB is not overloaded with too many operations at once.")
+@ReadsAttribute(
+    attribute = "mongodb.update.mode",

Review comment:
       The name of the attribute is used inconsistently. It is 
`mongodb.update.mode` here and in the drop-down list on the UI but the code 
expects `mongo.update.mode` when retrieves the attribute (also in the error 
message).
   Could you please introduce a constant for it?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to