<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Mongodb on Code and stuff</title>
    <link>https://www.drzon.net/tags/mongodb/index.xml</link>
    <description>Recent content in Mongodb on Code and stuff</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <copyright>All rights reserved - 2017</copyright>
    <atom:link href="https://www.drzon.net/tags/mongodb/index.xml" rel="self" type="application/rss+xml" />
    
    <item>
      <title>Export mongodb collections to csv without specifying fields</title>
      <link>https://www.drzon.net/posts/export-mongodb-collections-to-csv-without-specifying-fields</link>
      <pubDate>Tue, 31 Dec 2013 00:00:00 +0000</pubDate>
      
      <guid>https://www.drzon.net/posts/export-mongodb-collections-to-csv-without-specifying-fields</guid>
      <description>&lt;p&gt;Sometimes you might want to export your Mongodb database in &lt;code&gt;csv&lt;/code&gt; format. If you have many collections, it can be a bit of a hassle since &lt;a href=&#34;http://docs.mongodb.org/v2.2/reference/mongoexport/&#34;&gt;mongoexport&lt;/a&gt; requires you to specify each field you want to be exported with the &lt;code&gt;--fields&lt;/code&gt; attribute and you have to do it for each collection seperately.&lt;/p&gt;

&lt;p&gt;Here&amp;rsquo;s a little bash script that will do the work for you.&lt;/p&gt;

&lt;script src=&#34;https://gist.github.com/mderazon/8201991.js&#34;&gt;&lt;/script&gt;

&lt;p&gt;Result is a &lt;code&gt;.csv&lt;/code&gt; file for each collection you have in your db.&lt;/p&gt;
</description>
    </item>
    
  </channel>
</rss>