title: mongodump with multiple queries and oplog
body: <p><strong>Note:</strong> this question would usually be a better fit in the <a href="https://dba.stackexchange.com/">Database Administrators Stack Exchange</a> however I have a hunch it requires some programming to solve so I posted it here.</p>
  
  <hr>
  
  <p>Is there a way to pass <strong>multiple</strong> queries to <code>mongodump</code> to filter <strong>several</strong> collections in the <strong>same</strong> pass? I suspect there isn't (having trawled through the documentation with no dice) but I might have missed something along the way.</p>
  
  <p>With the <code>--oplog</code> option you can ensure that you have a <code>point-in-time snapshot</code> of the database.</p>
  
  <p>This is true if you can dump several collections in the same command. However if you want to filter multiple collections with different queries then that is no longer true if you have to run several commands in succession, since between the first command finishing and the second command starting there may have been operations that would affect the first result.</p>
  
  <p>I thought about running several commands in parallel, however I think it would strain the production system unnecessarily, especially since all of them would be dumping an <code>oplog</code>, because you wouldn't know beforehand which would finish first, and you would need the <code>oplog</code> of the command that finished last.</p>
  
  <p>At this moment I am thinking of rolling my own solution by monitoring the <code>oplog</code> myself and dumping it in a format that's valid for <code>mongorestore</code> during the entire process of running the dump commands.</p>
  
  <p>However before I attempt to re-invent the wheel I want to know if there's a supported way of achieving what I want, or at least some library that already does this since I don't think it's a unique use case.</p>