title: How to use the doValidate method of mongoose?
body: <p>I have the following schema</p>
  <pre class="lang-js prettyprint-override"><code>const mySchema = new mongoose.Schema({
     kind: {
        type: String,
        enum: { 
           values: [&quot;dollar&quot;, &quot;euro&quot;, &quot;pound&quot;, &quot;lira&quot;],
           message: &quot;only dollar, euro, pound or lira are allowed&quot;
        }
        required: [true, &quot;kind field is required&quot;]
     }
     // ... other fields
  })
  </code></pre>
  <p>I have the following code:</p>
  <pre class="lang-js prettyprint-override"><code>app.post(&quot;/route&quot;, async (req, res, next) =&gt; {
      //  write code here
  })
  
  </code></pre>
  <p>I want to validate only one path from that schema, I don't to validate everything, I just want to validate one field, so what I did according to this <a href="https://github.com/Automattic/mongoose/discussions/12004" rel="nofollow noreferrer">git discussion</a> is the following:</p>
  <pre class="lang-js prettyprint-override"><code>app.post(&quot;/route&quot;, async (req, res, next) =&gt; {
      //  
      await mySchema.path(&quot;kind&quot;).doValidate(req.body.kind)
  })
  
  </code></pre>
  <p>but this did not work and I got the following error:</p>
  <pre><code>.../node_modules/mongoose/lib/schematype.js:1332
          fn(err);
          ^
  
  TypeError: fn is not a function
      at .../node_modules/mongoose/lib/schematype.js:1332:9
      at processTicksAndRejections (node:internal/process/task_queues:78:11)
  </code></pre>
  <p>How can I use doValidate and get the benefit of it? and why there's no documentation on how to use it?</p>
  <ul>
  <li>and is there a way I can <em>promisify</em> it?</li>
  </ul>