title: MongoDB backup as text rather than binary for source control
body: <p>Is it possible to do this?</p>
  
  <p>The reason I ask is that it would seem useful to perform a backup as a pre-commit hook, and include that text-based backup somehow with the code being committed, such that every revision in source control (git) has the necessary backups associated with it.</p>
  
  <p>I realise that it may be possible to get MongoDB to spit out all it's collections as JSON, and back them up that way, but then this would not contain DB and collection metadata.</p>
  
  <p><strong>The central concern</strong> is that when branching to make changes to server side code, then reverting that branch, it is easy for us to forget to make the necessary backups that will allow an effective revert (code will no longer match schema). One could claim this is programmer error, but I think there should be some automation in place to ensure that we have a version of the database that is current for every version of the code. This is the problem with schemas that are amorphous during the early days of a project... dynamic schemas being Mongo's main blessing and curse.</p>