Github user MikeThomsen commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/2560#discussion_r175836334
  
    --- Diff: 
nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/PutMongo.java
 ---
    @@ -196,6 +237,33 @@ public void onTrigger(final ProcessContext context, 
final ProcessSession session
             }
         }
     
    +    private void removeUpdateKeys(String updateKeyParam, Map doc) {
    +        String[] parts = updateKeyParam.split(",[\\s]*");
    +        for (String part : parts) {
    +            if (part.contains(".")) {
    --- End diff --
    
    > we don't need them to exist in the parsed filter query, right?
    
    We do when replacing one document with another. Say you have a user account 
document, and the update key is `username`. If the user is doing full document 
replacement, and we remove the update key, the `username` field is going to be 
removed from the document that is used in the substitution. So then the poor 
end users will be searching through an accounts collection looking for 
documents with no usernames.


---

Reply via email to