Tool for export to JSON from ArangoDB - json

To create a native backup and restore it, one has to use arangodump and arangorestore.
To import from JSON (and CSV, TSV), one has to use arangoimp.
What can I use to export to JSON from ArangoDB?

One possibility is to use the arangodump tool that is shipped with ArangoDB.
It can be used to dump an entire database or individual collections. It stores dumped data in JSON format on disk.
Maybe arangodump's output already is in a format that you can work with.

Related

Export commands in MongoDB

i want to export all the queries in Mongo shell. I want get a file like sql(a file with table,inserts,querys...) but with MongoDB.
Im looking for a command for export that data and i watch a command for export the collection in a file .json, but thats not my idea.
Anyone know anything?
You have two options one export as JSON, second export as BSON.
For JSON you should use mongoimport and mongoexport binaries. Other way for BSON Mongo provides different binaries they are mongorestore and mongodump.
I'm sharing MongoDB documents, I hope those can help you.
JSON Export
https://docs.mongodb.com/v4.2/reference/program/mongoexport/#connect-to-a-mongodb-instance
BSON Export
https://docs.mongodb.com/v4.2/reference/program/mongodump/#connect-to-a-mongodb-instance
Notice that, BSON is not a human readable content, if you want to check what the exported file has you should try exporting in JSON.

ArangoDB: How to export collection to CSV?

I have noticed there is a feature in web interface of ArangoDB which allows users to Download or Upload data as JSON file. However, I find nothing similar for CSV exporting. How can an existing Arango DB collection be exported to a .csv file?
If you want to export data from ArangoDB to CSV, then you should use Arangoexport. It is included in the full packages as well as the client-only packages. You find it next to the arangod server executable.
Basic usage:
https://docs.arangodb.com/3.4/Manual/Programs/Arangoexport/Examples.html#export-csv
Also see the CSV example with AQL query:
https://docs.arangodb.com/3.4/Manual/Programs/Arangoexport/Examples.html#export-via-aql-query
Using an AQL query for a CSV export allows you to transform the data if desired, e.g. to concatenate an array to a string or unpack nested objects. If you don't do that, then the JSON serialization of arrays/objects will be exported (which may or may not be what you want).
The default Arango install includes the following file:
/usr/share/arangodb3/js/contrib/CSV_export/CSVexport.js
It includes this comment:
// This is a generic CSV exporter for collections.
//
// Usage: Run with arangosh like this:
// arangosh --javascript.execute <CollName> [ <Field1> <Field2> ... ]
Unfortunately, at least in my experience, that usage tip is incorrect. Arango team, if you are reading this, please correct the file or correct my understanding.
Here's how I got it to work:
arangosh --javascript.execute "/usr/share/arangodb3/js/contrib/CSV_export/CSVexport.js" "<CollectionName>"
Please specify a password:
Then it sends the CSV data to stdout. (If you with to send it to a file, you have to deal with the password prompt in some way.)

Export from Couchbase to CSV file

I have a Couchbase Cluster with only one node (let's call it localhost) and I need to export all the data from a very big bucket (let's call it XXX) into a CSV file.
Now this seems to be a pretty easy task but I can't find the way to make it work.
According to the (really bad) documentation on the cbtransfer toold from Couchbase http://docs.couchbase.com/admin/admin/CLI/cbtransfer_tool.html they say this is possible but they don't explain it clearly. They just add a flag if you want the transfer to occur in csv format (?) but it is not working. Maybe someone who already did this can give me a hand?
Using the documentation I've been able to make an approach to the result I want to obtain (a clean CSV file with all the documents in the XXX bucket) using this command:
/opt/couchbase/bin/cbtransfer http://localhost:8091 /path/to/export/output.csv -b XXX
But what I get is that /path/to/export/output.csv is actually a folder with a lot of folders inside and it is storing some kind of json metadata that can be used to restore the XXX bucket in another instance of Couchbase.
Has anyone been able to export data from a Couchbase bucket (Json documents) into a CSV file?
From looking at the documentation, you have to put a slightly different syntax to export to a CSV. http://docs.couchbase.com/admin/admin/CLI/cbtransfer_tool.html
It needs to look like so:
cbtransfer http://[localhost]:8091 csv:./data.csv -b default -u Administrator -p password
Notice the "csv:" before the name of the csv file.
I tested this and it does export a CSV. Just be forwarned that you need a relatively flat document structure for this to work really well, as JSON can represent far more complex data structures than CSV obviously, e.g. arrays, sub-documents, etc. cbtransfer will not unravel those. For example, if there is a subdocument, cbtransfer will represent it as a JSON doc in the line of each CSV.
So depending on what your document structure is, exporting to CSV is not an ideal format. It is a step backwards.

Does mongoDB has a mechanism like mysql ,which simple import .sql file into database?

As the title goes , I wonder if MongoDB has a data file format to import directly ?I know that mysql has "sql" file format for it to import directly .I am now in a project has the same requirement.Any one can tell me ?
MongoDB can import data using the mongoimport tool from JSON, CSV and TSV data format as you can see here
MongoDB internally represents data as a binary-encoded JSON (BSON), so importing and exporting in JSON format is really fast and intuitive
Of course.Mongodb use mongodump/mongoexport to export the data to outside files and use mongorestore/mongoimport to import data to its databases.more details , just reference to mongodb doc.mongodump and mongoexport ,mongorestore and mongoimport ,do have some differences .More details ,please refer to mongodb doc.

Mind Mapping tool exporting data to Rally

I am trying to export data from a Mind mapping tool such that it can be imported into Rally. Trying to create a mindmap of backlog which can be easily exported to a format compatible to rally ("csv"). I tried using different tools that export data to "csv" format which is Rally-compatible, however ran into some issues and hence decided to get the data into xml format and further convert just the required fields from the xml data to csv which can then be imported to rally.
What I have now is a process that can convert data to xml, I then further use a tool to get it to csv but the hierarchical structure of mindmapping is not maintained when I convert it to csv. So basically, now when I import "csv" data to rally, it doesn't keep parent relationships ( as seen in Mindmapper tool ) in backlogs.
Can anyone help me with this? Thanks!
Have you tried Rally Excel plugin that allows import to Rally from an Excel spreadsheet?
It does not have a direct support for importing parent/child relationship between stories, but if a story designated to be a parent already exists in Rally or imported first, then you may import another batch of stories with Parent field specified, and that will link the newly imported story or stories to the parent. See this video.