title: How to give validators in MongoDB?
body: <p>I'm working on a backend with MongoDB. I have already done server side validation using node js, now I need to add validation at database level.</p>
  
  <p>As of now I have  added one validator in MongoDB like this:</p>
  
  <pre><code>db.createCollection(name:("string")) 
  </code></pre>
  
  <p>Could you please tell me how to give required validators, unique validators,  exists validators in MongoDB?</p>