Example #1
0
def get_cursor(tbname,dbname=config.mongo['dbname']):
    conn = Simple_pymongo.get_instance()
    db = conn.__getattr__(dbname)
    cursor = db.__getattr__(tbname)
    return cursor
Example #2
0
def get_db(dbname):
    conn = Simple_pymongo(config.mongo['hosts'])
    return conn.__getattr__(dbname)