title: How to add Schema Dynamically in MongoDB/Mongoose
body: <p>I want to create a database thats defined by user, each user can have his own flavor of database. So i used <code>strict: false</code> But Now the problem is I cant make the user define the <code>type</code> of each schema under the model</p>
  <h1>Example</h1>
  <pre><code>const mongoose = require('mongoose');
  
  const testSchema = new mongoose.Schema({
      label: {
          required: 'please enter label',
          trim: true,
          type: String
      },
      url: {
          type: String,
          trim: true,
      },
      settings: {}  //User defined 
      }, {
          timestamps: true, strict: false
      });
  
  
  module.exports = mongoose.model('test', testSchema);
  </code></pre>
  <p>In the above case, I want the setting to be defined by user
  like,</p>
  <pre><code>{
      &quot;label&quot;: &quot;About Us&quot;,
      &quot;url&quot;: &quot;www.google.com&quot;,
      &quot;settings&quot;: { 
          &quot;name&quot;: {
              &quot;type&quot;: &quot;String&quot;,   //Problem is Here, i can't send datatype directly
              &quot;required&quot;: true
              },
          &quot;age&quot;: {
              &quot;type&quot;: &quot;Number&quot;,
              &quot;required&quot;: true,
              &quot;enum&quot;: [10, 12]
          }
      }
  }
  </code></pre>
  <p>So please tell help me, how can i make the user define the type of the schema?</p>