title: Mongo document versions array with draft version
body: <p>I am dealing with a CMS like system using MongoDB. Each item is meant to be versioned and there should also be a draft version. Most of the time we are interested in only the current published version.</p>
  
  <p>So, I have been thinking following:</p>
  
  <pre><code>{
     _id: "42",
     current: {
       name: "item1",
       detail: "baz"
     },
     draft: {
       name: "item1",
       detail: "draft stuff"
     },
     versions: [
                  {
                    version: "1",
                    name: "item1"
                    detail: "foo"
                  },
                  {
                    version: "2",
                    name: "item1"
                    detail: "bar"
                  }
                ]
   }
  </code></pre>
  
  <p>Creation of new current would go through 'draft' first and at the publishing stage it would replace current and old current would move to the array of versions. Similarly, rollback to an old version would happen by making a copy to draft.</p>
  
  <p>Does that make sense in context of MongoDB? Should I keep versions as an array in the same document as the current item?</p>