title: TypeError: Converting circular structure to JSON in retrieving html string from mongodb
body: <p>i am working to save a html snippet into the mongodb database, the save operation is successful however retrieving the data from mongo causes a failure 'TypeError: Converting circular structure to JSON'.</p>
  <p>the code is pretty simple</p>
  <pre><code>let database;
  let connection;
  
  exports.connectDatabase = function(MONGO_URL,DB_NAME) {
    MongoClient.connect(  MONGO_URL,  { useNewUrlParser: true, useUnifiedTopology: true }, (err, client) =&gt; {
        database = client.db(DB_NAME);
        connection = client;
      }
    );
  };
  
  exports.getDatabase = function(){
    return database;
  };
  
  
  
  exports.saveHtml = async function(req, res) {
    try{
      await getDatabase().collection('htmls').insertOne({name:req.body.title,  html:req.body.content });
      res.send('success');
    }catch(e){
      console.log(e);
      res.json(404);
      return;
    }
  }
  
  exports.getSavedHtmls =  async function(req,res){
    try{
      let html = await getDatabase().collection('htmls').find({});
      res.send(html);
    }catch(e){
      console.log(e);
      res.json(404);
      return;
    }
  }
  </code></pre>
  <p>the error is</p>
  <pre><code>TypeError: Converting circular structure to JSON
      --&gt; starting at object with constructor 'NativeTopology'
      |     property 's' -&gt; object with constructor 'Object'
      |     property 'sessionPool' -&gt; object with constructor 'ServerSessionPool'
      --- property 'topology' closes the circle
      at JSON.stringify (&lt;anonymous&gt;)
      at stringify (/Users/xisizhe/Documents/server/node_modules/_express@4.17.1@express/lib/response.js:1123:12)
  </code></pre>
  <p>How would I solve the issue?</p>