title: How to apply constraints in MongoDB?
body: <p>I have started using MongoDB and I am fairly new to it.
  Is there any way by which I can apply constraints on documents in MongoDB?
  Like specifying a primary key or taking an attribute as unique?
  Or specifying that a particular attribute is greater than a minimum value?</p>