# -*- coding: utf-8 -*-
import gzip, json, pymongo

filename = 'artist.json.gz'

def main(filename):
    con = pymongo.MongoClient('localhost', 27017)
    db = con.test
    col = db.artist
    with gzip.open(filename, 'r') as f:
        for line in f:
            jsondata = json.loads(line)
            col.insert_one(jsondata)

if __name__ == '__main__':
    main(filename)
