title: Managing database validations in MERN stack
body: <p>I'm coming from a Rails background and am trying out building a simple web app with the MERN stack. </p>
  
  <p>With Rails, I had a simple way to manage database-level validations: I would create a migration and set up the schema with validations, then run the migration. Moving to a production environment or after dropping the database, I could just run the same migration.</p>
  
  <p>With MongoDB, I know how to create database-level validations in the <code>mongo</code> console, but not how to manage the validations for reuse later.</p>
  
  <p>What are the best practices for managing database level validations with MongoDB (specific solutions for MERN are fine, though general solutions for just Mongo are fine too? Even better, is there a way to manage up/down validations in case I ever want to change something to a required field later in development but don't want to redo all of the validations from scratch?</p>
  
  <p>Thanks in advance!</p>