def run_pipeline_cursor(pipeline_collection_tuple, db):
    """Like run_pipeline but uses a cursor to access results larger than the max
       MongoDB size."""
    (pipeline, collection) = pipeline_collection_tuple
    cursor = db[collection].aggregate(pipeline, allowDiskUse=True, cursor={})
    results = []
    for doc in cursor:
        results.append(doc)
    return results