import json
import pymongo
from pymongo import MongoClient
with open('../Data/airTableYelp2399.json', 'r') as jFile:
    inLine = jFile.read()
    jOb = json.loads(inLine, 'utf8')
newJ = {}
for ele in jOb:
    ori = jOb[ele]
    ori['loc'] = {'type': 'Point', 'coordinates': jOb[ele][u'coordinates']}
    newJ[ele] = ori
client = MongoClient('localhost', 27017)
db = client.mydb
posts = db.airTable2399
for ele in newJ:
    posts.insert(newJ[ele])
posts.create_index([('loc', pymongo.GEOSPHERE)])

32b84e453c747facd7e5b0af20acdbcd418a687a
<mask token>

<mask token>
with open('../Data/airTableYelp2399.json', 'r') as jFile:
    inLine = jFile.read()
    jOb = json.loads(inLine, 'utf8')
<mask token>
for ele in jOb:
    ori = jOb[ele]
    ori['loc'] = {'type': 'Point', 'coordinates': jOb[ele][u'coordinates']}
    newJ[ele] = ori
<mask token>
for ele in newJ:
    posts.insert(newJ[ele])
posts.create_index([('loc', pymongo.GEOSPHERE)])

<mask token>
with open('../Data/airTableYelp2399.json', 'r') as jFile:
    inLine = jFile.read()
    jOb = json.loads(inLine, 'utf8')
newJ = {}
for ele in jOb:
    ori = jOb[ele]
    ori['loc'] = {'type': 'Point', 'coordinates': jOb[ele][u'coordinates']}
    newJ[ele] = ori
client = MongoClient('localhost', 27017)
db = client.mydb
posts = db.airTable2399
for ele in newJ:
    posts.insert(newJ[ele])
posts.create_index([('loc', pymongo.GEOSPHERE)])

import json
import pymongo
from pymongo import MongoClient
with open('../Data/airTableYelp2399.json', 'r') as jFile:
    inLine = jFile.read()
    jOb = json.loads(inLine, 'utf8')
newJ = {}
for ele in jOb:
    ori = jOb[ele]
    ori['loc'] = {'type': 'Point', 'coordinates': jOb[ele][u'coordinates']}
    newJ[ele] = ori
client = MongoClient('localhost', 27017)
db = client.mydb
posts = db.airTable2399
for ele in newJ:
    posts.insert(newJ[ele])
posts.create_index([('loc', pymongo.GEOSPHERE)])
