[ 
https://issues.apache.org/jira/browse/NIFI-2135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15352983#comment-15352983
 ] 

Thad Guidry commented on NIFI-2135:
-----------------------------------

We might also want to look in more detail about .upsert(upsert) 

The upsert option itself does a replace if NO MATCH 
https://api.mongodb.com/java/3.2/com/mongodb/client/model/UpdateOptions.html
which basically prescribes to this kind of handling 
https://docs.mongodb.com/manual/reference/method/db.collection.update/

I think PutMongo ​processor ​should have​ an option for the "upsert" with a 
help tip ideally?

> PutMongo replacing document instead of updating document
> --------------------------------------------------------
>
>                 Key: NIFI-2135
>                 URL: https://issues.apache.org/jira/browse/NIFI-2135
>             Project: Apache NiFi
>          Issue Type: Bug
>    Affects Versions: 0.6.1
>            Reporter: Bryan Bende
>            Priority: Minor
>
> How can I use put mongo processor to add a new key value pair to an existing 
> document? The flow file contains the document object Id. I have set 'mode' 
> property to 'update' and 'upsert' property to false and 'update query key' 
> property to '_id'. Flow file content is something like this.
> {
> _id:ObjectId(577216f0154b943fe8068079)
> expired:true
> }
> Without inserting the 'expired:true', it replaces the whole document with the 
> given one. So is there  a way to  insert the new key value pair to collection 
> without replacing the whole collection in MongoDB using putmongo processor? 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to