import json

def insert_data(data, db):

    # Your code here. Insert the data into a collection 'arachnid'

    pass


if __name__ == "__main__":
    
    from pymongo import MongoClient
    client = MongoClient("mongodb://localhost:27017")
    db = client.examples

    with open('arachnid.json') as f:
        data = json.loads(f.read())
        insert_data(data, db)
        print db.arachnid.find_one()
import json

def insert_data(data, db):
    db.arachnid.insert(data)
    # Your code here. Insert the data into a collection 'arachnid'

    pass


if __name__ == "__main__":

    from pymongo import MongoClient
    client = MongoClient("mongodb://localhost:27017")
    db = client.examples

    with open('arachnid.json') as f:
        data = json.loads(f.read())
        insert_data(data, db)
        print db.arachnid.find_one()
Add solution for Lesson_4_Problem_Set.02-Inserting_Into_DB