title: How to read data in collection in MongoDB?
body: <p>I am working on a social media app using Node.js and MongoDB. I've got a problem with reading the data in the collection. I want to get everything from the collection.</p>
  <p>Router.js:</p>
  <pre><code>router.get('/feed', async (req,res) =&gt; {
      try{
          await db.client.connect()
          await db.feed(db.client)
          res.render(&quot;feed&quot;)
      }catch(err){
          console.log(err)
      }finally{
          db.client.close()
      }
  })
  </code></pre>
  <p>Db.js</p>
  <pre><code>async function feed(client, res){
      let result = await client.db('secret_db').collection('secrets')
      console.log(result)
  }
  </code></pre>
  <p>Output:</p>
  <pre><code>Collection {
    s: {
      db: Db { s: [Object] },
      options: {
        raw: false,
        promoteLongs: true,
        promoteValues: true,
        promoteBuffers: false,
        ignoreUndefined: false,
        bsonRegExp: false,
        serializeFunctions: false,
        fieldsAsRaw: {},
        writeConcern: [WriteConcern],
        readPreference: [ReadPreference]
      },
      namespace: MongoDBNamespace { db: 'secret_db', collection: 'secrets' },
      pkFactory: { createPk: [Function: createPk] },
      readPreference: ReadPreference {
        mode: 'primary',
        tags: undefined,
        hedge: undefined,
        maxStalenessSeconds: undefined,
        minWireVersion: undefined
      },
      bsonOptions: {
        raw: false,
        promoteLongs: true,
        promoteValues: true,
        promoteBuffers: false,
        ignoreUndefined: false,
        bsonRegExp: false,
        serializeFunctions: false,
        fieldsAsRaw: {}
      },
      readConcern: undefined,
      writeConcern: WriteConcern { w: 'majority' },
      slaveOk: false
    }
  }
  </code></pre>
  <p>Take into consideration that I don't have a problem with rendering the pages. The problem must be done inside the async function feed()</p>