title: Set limits on mongo db collection
body: <p>So, there are two limits I want to set in mondo db:</p>
  
  <p><strong>1. Only allow one document to be inserted into the dbs, and no more. This document cannot be deleted once added, BUT it can be modified. Also, no other documents can be added to that collection.</strong></p>
  
  <p>Only one value will be allowed under this schema.</p>
  
  <pre><code>{ "_id" : ObjectId("5800"), "seconds" : "120", "__v" : 0 }
  </code></pre>
  
  <p>No more new seconds will be allowed to be added in, and only the above document can be modified.</p>
  
  <p>I have tried:</p>
  
  <pre><code>var numbersSchema = new mongoose.Schema({
    seconds: { type: Number, min: 60 }
  },{ capped : true, size:4000,  max : 1 })
  </code></pre>
  
  <p>However I can still add multiple documents:</p>
  
  <pre><code>{ "_id" : ObjectId("5800c7f53c609009dc5800f4"), "seconds" : 390, "__v" : 0 }
  { "_id" : ObjectId("5800c81b3c609009dc5800f5"), "seconds" : 590, "__v" : 0 }
  </code></pre>
  
  <p><strong>2.Set a min value on a schema entry field.</strong></p>
  
  <pre><code>var numbersSchema = new mongoose.Schema({
    seconds: Number
  })
  </code></pre>
  
  <p>So, in this case 'seconds' must be at least 60 seconds as the minimum value. I assume this needs to be changed in the schema, but I do not know how. Is it possible to add '>59' into the schema, or is there an option with mongo already?</p>
  
  <p>Any tips would be appreciated! </p>