title: TypeError: Object of type Cursor is not JSON serializable
body: <p>I'm creating a solar system application and having issues with the routing. I'm creating this app through with flask and using mongodb as a database.</p>
  <p>I've made sure that the files inserted into mongodb are json files and yet I receive the same error for all three routes. I've tried iterating through each doc in each collection and I've tried json dumping. Neither has worked. Any ideas?</p>
  <p><strong>app.py</strong></p>
  <pre><code>from flask import Flask, json, send_from_directory, request, jsonify
  from flask.templating import render_template
  from flask_restful import Api, Resource, reqparse
  from flask_cors import CORS #comment this on deployment
  from api.HelloApiHandler import HelloApiHandler
  from  pymongo import MongoClient
  
  app = Flask(__name__, static_url_path='', static_folder='Solar-System-Education\client\build')
  CORS(app) #comment this on deployment
  api = Api(app)
  
  client = MongoClient(&quot;mongodb+srv://username:password@capstone.tbgw0.mongodb.net/Capstone?retryWrites=true&amp;w=majority&quot;)
  db = client.Capstone
  planet_blurb = db.planet_descriptions
  quiz_questions = db.quizzes
  planet_stats = db.planets_info
  
  @app.route(&quot;/Planets&quot;, methods = ['GET'])
  def getplanetinfo():
      planets = (planet_stats.find())
      return jsonify(planets)
  
  @app.route(&quot;/Quiz&quot;, methods = [&quot;GET&quot;])
  def getquizquestions():
      quizzes = (quiz_questions.find())
      return jsonify(quizzes)
  
  @app.route(&quot;/Planets&quot;, methods = [&quot;GET&quot;])
  def getplanet_descriptions():
      descriptions = (planet_blurb.find())
      return jsonify(descriptions)
  
  
  
  @app.route(&quot;/&quot;, defaults={'path':''})
  def serve(path):
      return send_from_directory(app.static_folder,'index.html')
  
  api.add_resource(HelloApiHandler, '/flask/hello')
  </code></pre>
  <p>And just in case: <strong>HelloApiHandler.py</strong></p>
  <pre><code>from flask_restful import Api, Resource, reqparse
  
  class HelloApiHandler(Resource):
    def get(self):
      return {
        'resultStatus': 'SUCCESS',
        'message': &quot;Hello Api Handler&quot;
        }
  
    def post(self):
      print(self)
      parser = reqparse.RequestParser()
      parser.add_argument('type', type=str)
      parser.add_argument('message', type=str)
  
      args = parser.parse_args()
  
      print(args)
      # note, the post req from frontend needs to match the strings here (e.g. 'type and 'message')
  
      request_type = args['type']
      request_json = args['message']
      # ret_status, ret_msg = ReturnData(request_type, request_json)
      # currently just returning the req straight
      ret_status = request_type
      ret_msg = request_json
  
      if ret_msg:
        message = &quot;Your Message Requested: {}&quot;.format(ret_msg)
      else:
        message = &quot;No Msg&quot;
      
      final_ret = {&quot;status&quot;: &quot;Success&quot;, &quot;message&quot;: message}
  
      return final_ret
  </code></pre>
  <p><a href="https://i.stack.imgur.com/9FzkG.png" rel="nofollow noreferrer">full error details as requested</a></p>