title: throw new Error('Mongoose is not connected');
body: <h3>So I'm trying to use the mongoose-gridfs module with express but I get the following error when I try to run my express server.</h3>
  
  <pre><code>Error: Mongoose is not connected                                         
  at new GridFSStorage (C:\Users\BARMAN\Documents\Codes\zubis-mart\node
  _modules\mongoose-gridfs\lib\storage.js:43:11)                           
  at module.exports (C:\Users\BARMAN\Documents\Codes\zubis-mart\node_mo
  dules\mongoose-gridfs\lib\storage.js:472:18)                             
  at Object.&lt;anonymous&gt; (C:\Users\BARMAN\Documents\Codes\zubis-mart\rou
  tes\users.js:24:42)                                                      
  at Module._compile (module.js:653:30)                                
  at Object.Module._extensions..js (module.js:664:10)                  
  at Module.load (module.js:566:32)                                    
  at tryModuleLoad (module.js:506:12)                                  
  at Function.Module._load (module.js:498:3)                           
  at Module.require (module.js:597:17)                                 
  at require (internal/module.js:11:18)                                
  at Object.&lt;anonymous&gt; (C:\Users\BARMAN\Documents\Codes\zubis-mart\ser
  ver.js:15:15)                                                            
  at Module._compile (module.js:653:30)                                
  at Object.Module._extensions..js (module.js:664:10)                  
  at Module.load (module.js:566:32)                                    
  at tryModuleLoad (module.js:506:12)                                  
  at Function.Module._load (module.js:498:3)   
  </code></pre>
  
  <h2>Here's where I think the problem is from ##</h2>
  
  <pre><code>const express = require('express');
  const bcrypt = require('bcryptjs');
  const fs = require('fs');
  const mongoose = require('mongoose');
  const multer = require('multer');
  const passport = require('passport');
  
  const config = require('../config/database');
  
  mongoose.connect(config.database, {
      useNewUrlParser: true
  });
  
  let conn = mongoose.connection;
  
  conn.once('open', () =&gt; {
      console.log('Database File Upload Connection Established Successfully.');
  });
  
  conn.on('error', (err) =&gt; {
      console.log('File Connection Error... ' + err);
  });
  
  const gridfs = require('mongoose-gridfs')({
      collection: 'images',
      model: 'Image',
      mongooseConnection: conn
  });
  </code></pre>
  
  <p>My Connection string if okay but I just can't seem to figure it out. Really need help please. Thanks Guys!</p>