title: How to rename a mongodb database using pymongo?
body: <p>I need to rename a database I created using <code>pymongo</code>. I'd like to use <code>pymongo</code> to do it. I found <a href="https://stackoverflow.com/questions/9201832/how-do-you-rename-a-mongodb-database">this other stackoverflow question</a> that is very similar, and the code snippets look pythonesque, except the <code>use</code> keyword which makes it... I don't know what (Update: Perl probably?).</p>
  
  <p>I did a</p>
  
  <pre><code>client.copy_database('old_name', 'new_name)
  </code></pre>
  
  <p>And found that I then had <code>new_name</code> in `client.database_names()'. But it appears to have no collections in it? What else do I need to do, to deeply copy the database, using pymongo commands?</p>