title: How to get all the documents from mongodb?
body: <p>How can I get all the documents from mongodb using nodejs SDK ? I tried following approach to get all the documents but could't get any however insertions is working fine.</p>
  
  <pre><code>    // Connection URL
      var url = config.mongodbConnectionString;
      var db: any;
  
      // Use connect method to connect to the Server
      MongoClient.connect(url, function (err: any, database: any) {
          assert.equal(null, err);
          console.log("Connected correctly to server");
          db = database;
      });    
  
  export class MongodbProvider implements IDbProvider {    
  
      public getMenus(): any {
      var menus: any = [];
      try {
  
          db.open(function (err, db) {
              var cursor = db.collection('menus').find(function (err, cursor) {
                  cursor.each(function (err, doc) {
                      console.log(doc);
                       menus.push(doc);
                  });
              });
          });
      }
      catch (err) {
          console.log(err);
      }
      return menus;
  }
  }
  </code></pre>
  
  <p>Can you please help me in this? </p>