{"id":19027337,"url":"https://github.com/ngudbhav/excel-to-mongodb","last_synced_at":"2025-04-23T14:46:11.737Z","repository":{"id":49160144,"uuid":"152893742","full_name":"ngudbhav/excel-to-mongoDB","owner":"ngudbhav","description":"This module converts your correctly formatted Excel spreadsheet to a collection in the specified database in MongoDB.","archived":false,"fork":false,"pushed_at":"2022-10-15T17:05:18.000Z","size":92,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-18T00:56:26.954Z","etag":null,"topics":["excel","excel-to-mongo","mongo","mongodb","mongoose","npm","npm-install","npm-module","npm-package"],"latest_commit_sha":null,"homepage":"https://npm.im/excel-to-mongodb","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ngudbhav.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-13T16:53:43.000Z","updated_at":"2024-07-25T13:21:33.000Z","dependencies_parsed_at":"2022-07-30T14:48:04.063Z","dependency_job_id":null,"html_url":"https://github.com/ngudbhav/excel-to-mongoDB","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/ngudbhav%2Fexcel-to-mongoDB","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngudbhav%2Fexcel-to-mongoDB/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngudbhav%2Fexcel-to-mongoDB/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngudbhav%2Fexcel-to-mongoDB/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ngudbhav","download_url":"https://codeload.github.com/ngudbhav/excel-to-mongoDB/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250456611,"owners_count":21433721,"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":["excel","excel-to-mongo","mongo","mongodb","mongoose","npm","npm-install","npm-module","npm-package"],"created_at":"2024-11-08T21:07:57.839Z","updated_at":"2025-04-23T14:46:11.724Z","avatar_url":"https://github.com/ngudbhav.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# excel-to-mongoDB\r\n\r\n[![Build Status](https://travis-ci.com/ngudbhav/excel-to-mongoDB.svg?branch=master)](https://travis-ci.com/ngudbhav/excel-to-mongoDB)\r\n[![CircleCI](https://circleci.com/gh/ngudbhav/excel-to-mongoDB.svg?style=svg)](https://circleci.com/gh/ngudbhav/excel-to-mongoDB)\r\n\r\nThis module converts your correctly formatted Excel spreadsheet to a collection in specified database in MongoDB.\r\n\r\n## Excel Formats Supported\r\n\r\nSupported Excel formats are XLS/XLSX/CSV\r\n\r\n## Spreadsheet Format\r\n\r\nPlease have a look at the sample Excel sheets provided to have a clear view of the File. \u003ca href=\"https://go.microsoft.com/fwlink/?LinkID=521962\"\u003eMicrosoft Sample Sheet\u003c/a\u003e\r\n\r\n## Installation\r\n\r\n```sh\r\nnpm install excel-to-mongoDB --save\r\n```\r\n\r\n## Testing\r\n\r\n```sh\r\ngit clone https://github.com/ngudbhav/excel-to-mongoDB.git\r\ncd excel-to-mongoDB/\r\n```\r\n\r\nNavigate to the folder.\r\n\r\n```sh\r\ncd test/\r\nnano test.js\r\n```\r\n\r\nNow this file needs the MongoDB credentials. Provide those credentials in String format and save by pressing the following keys.\r\n\r\n```sh\r\n'CTRL+X'\r\n'Y'\r\n'Return'\r\n```\r\n\r\nGet back and test the module.\r\n\r\n```sh\r\ncd ..\r\nnpm test\r\n```\r\n\r\n## Using\r\n\r\nNote: Please correctly format the Excel sheet else this won't work.\r\n\r\n```sh\r\nvar excelMongo = require('excel-to-mongoDB');\r\n```\r\n\r\nThis module needs 3 arguments.\r\nThe first one is the object with your credentials.\r\n\r\n```sh\r\nvar credentials = {\r\n\thost: host,\r\n\tpath: path for the excel file,\r\n\tcollection: Collection name for creation,\r\n\tdb: Your Database name,\r\n\tuser: username for authentication. Leave blank if no authentication required,\r\n\tpass: password for authentication.\r\n\tconnection: Connection Object from mongodb client. Leave blank to create a connection,\r\n\tendConnection*: \r\n};\r\n```\r\n\r\n* Please note that endConnection false may not terminate the process.\r\n\r\nThe second one is an optional argument of options with default values as follows.\r\n\r\n```sh\r\nvar options = {\r\n\tsafeMode: false //Backup the db to the current working directory in dump/\u003cdb\u003e folder.\r\n\tverbose: false //Console.log the current step processing.\r\n\tcustomStartEnd: false //Custom insert the row and columns rather than full excel-file. Do take care! Specifying endRow or endCol may result in insertion of redundant data.\r\n\tstartRow: \u003crequired\u003e //Valid only if customStartEnd is true. Defines the start Row of the data.\r\n\tendRow: \u003crequired\u003e //Valid only if customStartEnd is true. Defines the end Row of the data.\r\n\tstartCol: \u003crequired\u003e //Valid only if customStartEnd is true. Defines the start Column of the data.\r\n\tendCol: \u003crequired\u003e //Valid only if customStartEnd is true. Defines the end Column of the data.\r\n\tdestination: '' // Valid only if safeMoode is true. Defines the destination of the dump file of db\r\n}\r\n```\r\n\r\nThe third argument is the callback function which should be executed.\r\n\r\n```sh\r\ntry {\r\n  excelMongo.covertToMongo(credentials, options, callback); //returns documents inserted in the database.\r\n} catch(error) {\r\n  throw error;\r\n}\r\n```\r\n\r\n`try/catch` is always recommended because of the type of errors that can occur.\r\n\r\n## Error in safeMode option\r\n\r\n```sh\r\nWindows users need to add the following path to the environment path variable.\r\nC:\\Program Files\\MongoDB\\Server\\\u003cversion\u003e\\bin\r\n\r\nRight click 'This PC', head to 'properties' and 'Advanced System Settings'. From there, Click on 'Environment Variables'. Under System Variables, Search for 'PATH'. Double click the entry, click on new and add the above path.\r\nRestart your console and you should be good to go.\r\n\r\nLinux/Unix Users please check your installation or .bashrc.\r\n```\r\n\r\n## Want to covert to MYSQL instead?\r\n\r\nWe have got you covered! \u003ca href=\"https://github.com/ngudbhav/excel-to-mysql\"\u003eGitHub Link\u003c/a\u003e.\r\n\r\n## Want to use the GUI instead?\r\n\r\nWe have got you covered! \u003ca href=\"https://github.com/ngudbhav/TriCo-electron-app\"\u003eGitHub Link\u003c/a\u003e.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fngudbhav%2Fexcel-to-mongodb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fngudbhav%2Fexcel-to-mongodb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fngudbhav%2Fexcel-to-mongodb/lists"}