def lyrics_from_db(coll, 
                   lyric_field,
                   sample_size='all', 
                   min_year=1965, 
                   max_year=1975):
    """
    Returns raw lyrics and corresponding BSON IDs for songs within the min 
    year/max year range (inclusive). Returns all songs in range, or a sample of
    given size.
    ---
    IN
    coll: MongoDB lyrics collection
    lyric_field: exact name of lyric field to load (str)
    sample_size: number of songs in sample (int), or 'all' if all in range 
        (str)
    min_year: lower bound for samples (int)
    max_year: upper bound for samples (int)
    OUT
    lyrics: list of raw lyrics (list)
    song_ids: list of BSON IDs corresponding with lyrics list (list)
    """
    
    if sample_size == 'all':
        docs = coll.find({'Year': {"$gte": min_year, "$lte": max_year},
                          lyric_field: {"$exists": True}})
        
    else:
        assert type(sample_size) == int, "size must be an integer if not 'all'"
        docs = coll.aggregate([{"$match": 
                                {"$and": [{'Year': {"$gte": min_year, 
                                                    "$lte": max_year}},
                                          {lyric_field: {"$exists": True}}
                                         ]}},
                               {"$sample": {"size": sample_size}}
                              ])
    
    lyrics = []
    song_ids = []
    for doc in docs:
        lyrics.append(doc[lyric_field])
        song_ids.append(doc['_id'])
    
    return lyrics, song_ids