Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alfierichou/excel-to-mongo
import multi excel data to mongodb
https://github.com/alfierichou/excel-to-mongo
Last synced: 15 days ago
JSON representation
import multi excel data to mongodb
- Host: GitHub
- URL: https://github.com/alfierichou/excel-to-mongo
- Owner: AlfieriChou
- Created: 2018-09-11T13:29:44.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-19T06:54:25.000Z (about 6 years ago)
- Last Synced: 2024-04-23T10:45:33.936Z (8 months ago)
- Language: JavaScript
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# excel-to-mongo
### install
```bash
npm install xlsx-to-mongo
```### 说明
* 目录可自定义
* 如果没有输入密码,连接的数据库地址为mongodb://`${host}`:`${port}`
* 查重(如果Excel表中的第一条存在数据库中,那么,这个Excel表将不会导入)### example
```javascript
const xlsxToMongo = require('xlsx-to-mongo')const options = {
user: 'root',
password: 'password',
host: '127.0.0.1',
port: '27017',
db: 'test',
collection: 'users',
dir: __dirname + '/excel/'
}xlsxToMongo(options)
```* options
* user: mongodb用户
* password: mongodb密码
* host: mongodb host
* port: mongodb port
* db: mongodb数据库名
* collection: mongodb collection
* dir: 目标目录(要导入的Excel目录路径)