def METHOD_NAME(db, coll, attribute):
    '''
    Finds the number of distinct values for attribute across every document in
    db[coll] collection, and adds an entry {_id : attribute, distinct : count} to
    the db[coll.stats] collection, where count is the number of distinct values
    for that attribute
    '''
    coll = str(coll)
    attribute = str(attribute)
    count = len(db[coll].distinct(attribute))
    doc = {'_id' : attribute, 'distinct':count}
    db[coll + '.stats'].replace_one({'_id':attribute}, doc, upsert=True)