title: How can I set MongoDB's path with the C# driver?
body: <p>I currently run MongoDB pointing to the appropriate data directory using the command line below:</p>
  
  <pre><code>mongod --dbpath "somePath/data"
  </code></pre>
  
  <p>But currently this is a manual step that I run before running a particular suite of tests. Is there a way I can set the path within the code (without calling a script or batch file) using the Mongo C# driver to use a specific data directory?</p>
  
  <p><strong>Update</strong>:</p>
  
  <p>To clarify, the reason I'm looking to do this isn't for use in production code, but to isolate test databases for different test suites and to point at a disposable and isolated data directory so that each server instance is clean at the time of running tests and is only populated with the data it requires for the same server settings as production.</p>