def __init__(self, database='<STR_LIT>', host='<STR_LIT:localhost>', port=<NUM_LIT>,<EOL>user=None, pwd=None):
if user and pwd:<EOL><INDENT>connection_string = '<STR_LIT>' %(user, pwd, host, port)<EOL><DEDENT>else:<EOL><INDENT>connection_string = '<STR_LIT>' %(host, port)<EOL><DEDENT>self.db = MotorClient(connection_string).open_sync()[database]<EOL>
initialize a mongodb connection to mongodb://user:pass@host:port
use database