I am using Python ExecuteScript in Apache NiFi to list all Databases name in Mongo then load all tables name in Mongo, however, they dont have lib mongo. Do you know How to import python libs for ExecuteScript?
Or any suggestions to load all Databases name and tables name in Mongo in Nifi
Does your Python script execute fine via command line on your NiFi servers?
If so, did you consider instead just using the ExecuteStreamCommand processor to execute your script? This will behave in same way as executing yourself form command line and will not rely on NiFi built in libs.
The latest version of NiFi contain numerous mongo specific processors. I am not a Mongo user myself, but have you looked to see if any of those would meet the needs of your dataflow here?
If you found this answer addressed your question, please take a moment to login in and click the "ACCEPT" link.
If the "mongo" library contains native Python (CPython) code or dependencies, you can't use them in ExecuteScript (which uses Jython not Python). See Matt C's answer for a workaround to use actual Python.