title: Rename mongo collection without knowing its namespace
body: <p>I am using liquibase and mongo to execute a rename-migration like that:</p>
  <pre><code>&lt;ext:runCommand&gt;
    &lt;ext:command&gt;&lt;![CDATA[
      {
        renameCollection: &quot;XXX.foo&quot;,
        to: &quot;XXX.bar&quot;
      }
    ]]&gt;&lt;/ext:command&gt;
  &lt;/ext:runCommand&gt;
  </code></pre>
  <p>The renaming happens within the bounds of the existing DB, so cross-db migrations are not relevant to my usecase. My problem is that I do now know XXX in advance. My liquibase migration is intended to run in multiple environmets and each one uses its unique version of XXX.</p>
  <p>Also, liquibase limits me to runCommand/adminCommand semantics, and the <a href="https://docs.mongodb.com/manual/reference/command/renameCollection/" rel="nofollow noreferrer">spec for them</a> clearly says that I should provide full namespaces for that, which I cannot have.</p>
  <p>Of course I could create multiple liquibase change sets, one for each environment, and hardcode the proper namespace for each one. But I would like to avoid that option since it will does not scale very well.</p>
  <p>Is there any way to rename a mongo collection (using runCommand/adminCommand semantics), in a <strong>namespace agnostic</strong> way?</p>