I have tried following ways but could not achieve the output.
1) Using Mongodb source config and mongodb script Error: code 13 : unauthorized
2) USing JSR223 Sampler (lang :python) Error :javax.script.ScriptException: ImportError: No module named pymongo in at line number 6
Code:
import random import datetime import string import sys sys.path.append("/usr/lib64/python2.7/site-packages/pymongo") from pymongo import MongoClient
def connection(): global db connection=MongoClient(HOSTNAME,PORT) db=connection[DATABASE] db.authenticate(USERNAME,PASSWORD)