[
https://issues.apache.org/jira/browse/NIFI-5305?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16543920#comment-16543920
]
Mike Thomsen commented on NIFI-5305:
------------------------------------
[~calderonmluis] Your stacktrace shows no value for the collection name. See:
> 'Invalid namespace specified 'my-schema.'' on server mongodb:22277
> com.mongodb.MongoQueryException: Query failed with error code 73 and error
> message 'Invalid namespace specified 'my-schema.''
So, as far as I can tell, it should be failing here. If you look at the setup
method of GetMongoIT in GitHub, you'll see that we actually start with an
expression language statement like this:
{code:java}
runner = TestRunners.newTestRunner(GetMongo.class);
runner.setVariable("uri", MONGO_URI);
runner.setVariable("db", DB_NAME);
runner.setVariable("collection", COLLECTION_NAME);
runner.setProperty(AbstractMongoProcessor.URI, "${uri}");
runner.setProperty(AbstractMongoProcessor.DATABASE_NAME, "${db}");
runner.setProperty(AbstractMongoProcessor.COLLECTION_NAME, "${collection}");
runner.setProperty(GetMongo.USE_PRETTY_PRINTING, GetMongo.YES_PP);
runner.setIncomingConnection(false);
{code}
Can you provide more details about your particular use?
> Parameterized collection name fails with dynamic params
> -------------------------------------------------------
>
> Key: NIFI-5305
> URL: https://issues.apache.org/jira/browse/NIFI-5305
> Project: Apache NiFi
> Issue Type: Bug
> Affects Versions: 1.6.0
> Reporter: Luis M Calderon
> Assignee: Mike Thomsen
> Priority: Major
> Attachments: getmongo_error.txt
>
>
> When using a dynamic property for collection name, the creation of the full
> query reference name is not working as expected. The reference name seems to
> be the concatenation of the namespace and collection name. i.e.
> _<namespace>.<collection_name>)_
> The following parameters are those which are provided to the GetMongo
> Processor:
> Param Definitions:
> my_schema = 'my_schema'
> collection_name = <dynamic value from a FlowFile attribute>
> {code:java}
> Mongo Database Name: ${my_schema}
> Mongo Collection Name: ${collection_name}{code}
>
> Attached is a text file containing the NiFi log for this error.
>
> _There is no namespace error when the same values are hard coded._
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)