""""mongodb client"""
from pymongo import MongoClient

MONGO_DB_HOST = 'localhost'
MONGO_DB_PORT = '27017' # default port
DB_NAME = 'tap-news' #database name which may connect many collection

# singelton client
client = MongoClient("%s:%s" %(MONGO_DB_HOST, MONGO_DB_PORT))
# if there is no argument,use the defualt DB_NAME
# Othewise, use the passed in argument
def get_db(db=DB_NAME):
    """get database instance"""
    db = client[db]
    return db

1fb335e081d5e6eddcf8087fb6b8a0ff7a6e2842
<mask token>

<mask token>


def get_db(db=DB_NAME):
    """get database instance"""
    db = client[db]
    return db

<mask token>
MONGO_DB_HOST = 'localhost'
MONGO_DB_PORT = '27017'
DB_NAME = 'tap-news'
client = MongoClient('%s:%s' % (MONGO_DB_HOST, MONGO_DB_PORT))


def get_db(db=DB_NAME):
    """get database instance"""
    db = client[db]
    return db

<mask token>
from pymongo import MongoClient
MONGO_DB_HOST = 'localhost'
MONGO_DB_PORT = '27017'
DB_NAME = 'tap-news'
client = MongoClient('%s:%s' % (MONGO_DB_HOST, MONGO_DB_PORT))


def get_db(db=DB_NAME):
    """get database instance"""
    db = client[db]
    return db

""""mongodb client"""
from pymongo import MongoClient

MONGO_DB_HOST = 'localhost'
MONGO_DB_PORT = '27017' # default port
DB_NAME = 'tap-news' #database name which may connect many collection

# singelton client
client = MongoClient("%s:%s" %(MONGO_DB_HOST, MONGO_DB_PORT))
# if there is no argument,use the defualt DB_NAME
# Othewise, use the passed in argument
def get_db(db=DB_NAME):
    """get database instance"""
    db = client[db]
    return db
