Commit 103754345878c35b64e889dc0c0c107d6ee62fe3

  • avatar
  • arvind
  • Tue Jul 16 15:44:58 IST 2013
pymongo updated methods to write and initiate a db
server.py
(3 / 3)
  
3131
3232@app.route('/fetch', methods=['GET'])
3333def fetch():
34 connection = pymongo.Connection()
34 connection = pymongo.MongoClient('localhost',27017)
3535 db = connection['mural']
3636 collection = db['data']
3737 ret = {}
5858
5959@app.route('/search', methods=['GET'])
6060def search():
61 connection = pymongo.Connection()
61 connection = pymongo.MongoClient('localhost',27017)
6262 db = connection['mural']
6363 collection = db['data']
6464 y = 0
9797
9898@app.route('/submit', methods=['POST'])
9999def submit():
100 c = pymongo.Connection()
100 c = pymongo.MongoClient('localhost',27017)
101101 db = c['mural']
102102 coll = db['data']
103103 requestData = json.loads(request.form['data'])