title: Is validation possible in Mongo DB on a batch insert?
body: <p>I am performing a batch insert on a table using Mongoid where batch is an array of hashes:</p>
  
  <pre><code>@state = State.new
  @state.collection.insert batch
  </code></pre>
  
  <p>Am I bypassing Activerecord by doing it this way?  When I try to validate a record nothing happens.</p>
  
  <pre><code>validates_format_of :population, :with =&gt; /\d+/
  </code></pre>
  
  <p>I'm also trying to perform a callback to format the data.</p>
  
  <pre><code>before_validation :generate_population
  </code></pre>
  
  <p>And nothing happens.</p>