title: Does MongoDB provide a way to generate sequential values?
body: <p>I'm developing a web application in Java and storing some data on a MongoDB using Morphia.<br>
  Besides the <code>ObjectId</code>, I need to persist a sequential value for each document of a collection. This sequential value must be unique in the collection.  </p>
  
  <p>My first approach would be create a collection to store only the sequential value and synchronize the method which gets and increments the value.  </p>
  
  <p>Are there any better ways to do it?</p>