{"id":615,"date":"2017-11-27T14:43:55","date_gmt":"2017-11-27T09:13:55","guid":{"rendered":"http:\/\/www.cyberaka.com\/?p=615"},"modified":"2017-11-27T14:53:52","modified_gmt":"2017-11-27T09:23:52","slug":"export-json-from-robomongo","status":"publish","type":"post","link":"https:\/\/www.cyberaka.com\/?p=615","title":{"rendered":"Export JSON from RoboMongo"},"content":{"rendered":"<p>I use RoboMongo extensively for all my Mongo development work \/ debugging. I however sorely needed a way to export JSON from it. A\u00a0<a href=\"https:\/\/stackoverflow.com\/questions\/28733692\/how-to-export-json-from-mongodb-using-robomongo\/43499431#43499431\">Stack Over Flow<\/a> link came up in a Google search and I was able to export JSON for my use. Basically you need to execute this command which uses &#8220;printjsononeline&#8221; function provided by Mongo to give you one line JSON for each row in the collection:<\/p>\n<pre>db.getCollection('collection_name').find({}).forEach(function(x){printjsononeline(x)});<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I use RoboMongo extensively for all my Mongo development work \/ debugging. I however sorely needed a way to export JSON from it. A\u00a0Stack Over Flow link came up in a Google search and I was able to export JSON for my use. Basically you need to execute this command which uses &#8220;printjsononeline&#8221; function provided [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[60,59],"tags":[],"class_list":["post-615","post","type-post","status-publish","format-standard","hentry","category-mongo","category-nosql"],"_links":{"self":[{"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/posts\/615","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=615"}],"version-history":[{"count":2,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/posts\/615\/revisions"}],"predecessor-version":[{"id":617,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/posts\/615\/revisions\/617"}],"wp:attachment":[{"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=615"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=615"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=615"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}