{"id":16578055,"url":"https://github.com/glynnbird/documentdbexport","last_synced_at":"2025-10-25T15:09:54.873Z","repository":{"id":57214354,"uuid":"84468852","full_name":"glynnbird/documentdbexport","owner":"glynnbird","description":"Export a DocumentDB collection to JSON","archived":false,"fork":false,"pushed_at":"2017-03-27T18:59:42.000Z","size":4,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-08T11:49:30.601Z","etag":null,"topics":["command-line","documentdb","export","json"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/glynnbird.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-09T17:15:18.000Z","updated_at":"2017-07-24T01:47:43.000Z","dependencies_parsed_at":"2022-08-26T13:41:34.632Z","dependency_job_id":null,"html_url":"https://github.com/glynnbird/documentdbexport","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glynnbird%2Fdocumentdbexport","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glynnbird%2Fdocumentdbexport/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glynnbird%2Fdocumentdbexport/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glynnbird%2Fdocumentdbexport/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/glynnbird","download_url":"https://codeload.github.com/glynnbird/documentdbexport/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glynnbird%2Fdocumentdbexport/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":258827854,"owners_count":22763908,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-line","documentdb","export","json"],"created_at":"2024-10-11T22:13:00.540Z","updated_at":"2025-10-25T15:09:54.804Z","avatar_url":"https://github.com/glynnbird.png","language":"JavaScript","readme":"# documentdbexport\n\nCommand-line utility to export a DocumentDB database/collection to a list of JSON documents.\n\n## Installation\n\nThe *documentdbexport* package is installed via npm:\n\n```sh\nnpm install -g documentdbexport\n```\n\nYou may need to precede the above command with `sudo`, depending on your Node.js installation.\n\n## Configuration\n\nThe *documentdbexport* is configured by setting your Azure Endpoint and URL asas environment variables:\n\n```sh\nexport AZURE_ENDPOINT=\"https://mydocumentdb.documents.azure.com:443/\"\nexport AZURE_KEY=\"GeIZysnonvgpk2\"\n```\n\n## Command-line Usage\n\nUse the *documentdbexport* tool to export an entire DocumentDB collection. The database is specified with `-d` and the collection with `-c`:\n\n```sh\n$ documentdbexport -d iot -c temperaturereadings\n{\"temperature\":8391,\"time\":\"2017-03-09T01:38:11+0000\",\"id\":\"1489023491\"}\n{\"temperature\":29130,\"time\":\"2017-03-09T02:35:37+0000\",\"id\":\"1489026937\"}\n{\"temperature\":27650,\"time\":\"2017-03-08T18:35:58+0000\",\"id\":\"1488998158\"}\nExport complete { records: 3, time: 0.145 }\n```\n\nThe data can be directed to a text file:\n\n```sh\n$ documentdbexport -d iot -c temperaturereadings \u003e mydata.txt\nExport complete { records: 3, time: 0.145 }\n```\n\nor piped elsewhere e.g. to [couchimport](https://www.npmjs.com/couchimport) to import the data into Apache CouchDB:\n\n```sh\n$ documentdbexport -d iot -c temperaturereadings | couchimport --db mycouchtable --type jsonl\nExport complete { records: 3, time: 0.145 }\ncouchimport writecomplete { total: 3, totalfailed: 0 } +20ms\ncouchimport Import complete\n```\n\n## Programmatic Usage\n\nYou can also use the library within your own code:\n\n```js\nvar documentdbexport = require('documentdbexport');\nvar endpoint = 'https://mydocumentdb.documents.azure.com:443/';\nvar key = 'GeIZysnonvgpk2';\nvar database = 'mydatabase';\nvar collection = 'mycollection';\ndocumentdbexport.exportCollection(endpoint, key, database, collection, function(err, data) {\n  if (err) {\n    console.error('ERROR', err)\n  } else {\n    console.error('Export complete', data)\n  }\n});\n```\n\n## Options Reference\n\n### Command-line parameters\n\n* -d or --database - the database to work with (required)\n* -c or --collection - the collection to export (required)\n\n### Environment variables\n\n* AZURE_ENDPOINT - the Azure endpoint URL key\n* AZURE_KEY - the Azure primary API key\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglynnbird%2Fdocumentdbexport","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglynnbird%2Fdocumentdbexport","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglynnbird%2Fdocumentdbexport/lists"}