import json


def load_json(filename):
    """Loads a JSON file and returns a dict of its documents."""
    docs = {}
    with open(filename, encoding="utf-8") as fh:
        lines = fh.readlines()
    for line in lines:
        doc = json.loads(line)
        docs[doc["_id"]] = doc
    return docs