def collection_from_event()

in docdb_rest/app.py [0:0]


def collection_from_event(event):
    path = event["path"].rstrip("/")
    print("path: " + path)
    splits = path.split("/")
    collection_name = splits[-1]
    db_name = splits[-2]
    get_db_client()
    print("db_name: " + db_name + "; collection_name: " + collection_name)
    db = db_client[db_name]
    collection = db[collection_name]
    return collection