title: Python removing additional key from result
body: <p>Hi I am experimenting with python and mongodb with tornado framework. I am having entry module where user can insert the data of students in academic and sports field. I am using PostMan to verify the code.</p>
  
  <pre><code>def post(self):
      print(json_encode(self.body))
      db.SearchLog.insert(self.body)
      default = 'None'
      Date = self.body.get('Date', default)
      Reg = self.body.get('Reg', default)
      Name = self.body.get('Name', default)
      cursor = db.studentDetails.find({'Reg': Reg, 'Name': Name})
      value = yield cursor.count()
      if value is 0:
          db.studentDetails.insert(self.body)
  
      else:
          self.write("{"'"success"'": 1, "'"data"'":[")
          for document in (yield cursor.to_list(length=100)):
              self.write(format(JSONEncoder().encode(document)))
              c = 1
              if (c &lt; value):
                  c+=1
                  value = value - 1
                  self.write(",")
          self.write("]}")
  </code></pre>
  
  <p>The code works ok. But the problem is with the way the output is displayed.</p>
  
  <p>The output looks like this</p>
  
  <pre><code>{"success": 1, "data":[{"_id": "55acc2205d8882ef8a667d34", "Reg": "11mt", "Name": "Alex", "Total": "98"}]}
  
  {"data": null, "status": "success"}
  </code></pre>
  
  <p>Because of the presence of two data I could not get the values Name ,Total, Reg.</p>
  
  <p>Is there a way I can send <code>[{"_id": "55acc2205d8882ef8a667d34", "Reg": "11mt", "Name": "Alex", "Total": "98"}]</code> instead of 'null'.</p>
  
  <p>My output should be like <code>{"data":"[{"_id": "55acc2205d8882ef8a667d34", "Reg": "11mt", "Name": "Alex", "Total": "98"}]" , "status": "success"}</code></p>
  
  <p>The additional <code>{"data": null, "status": "success"}</code> I dont know how this is coming.</p>