[
https://issues.apache.org/jira/browse/NIFI-5589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16612674#comment-16612674
]
ASF GitHub Bot commented on NIFI-5589:
--------------------------------------
Github user MikeThomsen commented on a diff in the pull request:
https://github.com/apache/nifi/pull/2999#discussion_r217172110
--- Diff:
nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/PutMongo.java
---
@@ -112,8 +112,10 @@
.allowableValues(UPDATE_WITH_DOC, UPDATE_WITH_OPERATORS)
.defaultValue(UPDATE_WITH_DOC.getValue())
.description("Choose an update mode. You can either supply a JSON
document to use as a direct replacement " +
- "or specify a document that contains update operators like
$set and $unset")
- .build();
+ "or specify a document that contains update operators like
$set, $unset, and $inc."+
+ "When Operators mode is enabled, the flowfile
content is expected to be the operator part"+
+ "for example: {$set:{\"key\":
\"value\"},$inc:{\"count\":1234}} and Update query has to be the record to be
updated")
--- End diff --
(Just push that branch to GitHub, I'll fetch it and merge)
> Clarify putMongo documentation
> ------------------------------
>
> Key: NIFI-5589
> URL: https://issues.apache.org/jira/browse/NIFI-5589
> Project: Apache NiFi
> Issue Type: Improvement
> Reporter: Joseph Niemiec
> Assignee: Vijeta Hingorani
> Priority: Minor
>
> Today the putMongoDB documentation is very vugae and leads to alot of playing
> around to understand exactly how it works. We would improve the documentation
> so that others can immediately start to use this processor successfully.
>
> My largest issues where around understanding how the UpdateQuery works, and
> the expected content + operators that can be used when performing the update
> with operators and not just replacing the entire document.
>
>
> Here is a misc note I made on my experience doing this.
> With the putMongo processor the updateQuery is like a find() in the mongo
> CLI, all documents that match the find will be replaced with the flowfile
> content. The update mode has 2 choices; whole document or with operators. If
> your updating the entire document it expects the json to be properly
> formated. The UpdateQuery will return to this processor the documents which
> need to be completely replaced with the incoming FlowFile content. If your
> using this with operators its expected that the FlowFile content ONLY be the
> operator part you need is {$set: {"f1": "val1"} , $inc :{ "count" : 10}}, it
> doesnt not support the find() portion that you would expect in the CLI, that
> part is the 'UpdateQuery'
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)