title: Multer gridfs storage referencing uploaded file to a new collection
body: <p>Uploaded file using multer gridfs storage i want to reference it to newly created collection (movies). 
  The fileID i referenced to the uploaded file is not the same with the uploaded file, even with that the movies collection is not saved on to the database.
  The fileID i referenced to the uploaded file is not the same with the uploaded file, even with that the movies collection is not saved on the database </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>//movie schema
      const mongoose = require('mongoose');
      const Schema = mongoose.Schema;
  
      const MovieSchema = new Schema({
       description: {
        type: String,
       },
       category: {
        type: String,
       },
       token: {
        type: String,
       },
       fileID: {
        type: Schema.Types.ObjectId,
        ref: "contents.files"
       }
      });
  
      module.exports = movies = mongoose.model('movies', MovieSchema);
  
  
  
      let gfs;
  
      conn.once('open', () =&gt; {
          gfs = Grid(conn.db, mongoose.mongo);
          gfs.collection('contents');
  
      });
  
  
  
      const storage = new GridFsStorage({
          url: config.db,
          file: (req, file) =&gt; {
              return new Promise((resolve, reject) =&gt; {
              
                      const filename = req.body.fileName + path.extname(file.originalname);
                      const Description = req.body.Description
                      const fileInfo = {
                          filename: filename,
                          bucketName: 'contents',
                          metadata: req.body,
                          
                      }
                      resolve(fileInfo, Description);
                  
              });
          }
      });
      const   upload = multer({
          storage
      });
      router.get('/', (req, res) =&gt; {
          res.render('index');
          console.log(req.body)
      });
  
      //** uploading file to the db */
  
      router.post('/', upload.any(), (req, res) =&gt; {
          
            
          const movie = new movies({
              description: "test",
              category: "test",
              fileID: gfs.files.id
          })
          
            movie.save()
      });</code></pre>
  </div>
  </div>
  </p>
  
  <p>The fileID is different from uploaded file Id and also the collection is not saved on the DB The fileID is different from uploaded file Id and also the collection is not saved on the DB The fileID is different from uploaded file Id and also the collection is not saved on the DB</p>