def collection_exists(collectionName, collections):
    """Checks if a collection exists in the database"""
    res = False
    if collections and collectionName:
        res = collectionName in collections
    return res