title: Upload multiple files in nodejs express with destination name as a new object id
body: <p>I'm working on Nodejs, Express and Mongodb backend (and postman). I want to get form data fields from postman which are <code>title</code>, <code>subject</code>, <code>coverPhoto</code> and <code>attachment</code> where title and subject are text fields (in postman form-data) and coverPhoto and attachment are files.</p>
  <p><strong>What I want:</strong>
  I have a schema for book like -</p>
  <pre><code>const bookSchema= new mongoose.Schema({
    title: {
      type: String,
      required: true
    },
    subject{
      type: String,
      required: true,
    },
    coverPhoto{
      type: String,
    },
    attachment{
      type: String
    }
  });
  </code></pre>
  <p>and a router such as -</p>
  <pre><code>router.post('/book',[//express-validator checks] , (req,res) =&gt; 
  {
      //... some code ...
      let book = new bookSchema({title,subject,coverPhoto,attachment}); // save to schema
  });
  </code></pre>
  <p>I want to make a new mongo bookSchema object where I will save paths for coverPhoto and attachment in their respective fields.</p>
  <p>Problem: I want each book to be saved in a separate directory based on their object id (which the new object will return i.e <code>book._id</code> (mongoose id))
  e.g <code>/uploads/60d4cdc5c6f54c051cf01fed/cover-image.png</code> and <code>/uploads/60d4cdc5c6f54c051cf01fed/book.pdf</code></p>
  <p>I have tried as much as I could with multer but I can't achieve this desired output. If anyone can help please do.</p>