xlsx-to-mongo

1.0.3 • Public • Published

excel-to-mongo

install

npm install xlsx-to-mongo

说明

* 目录可自定义
* 如果没有输入密码,连接的数据库地址为mongodb://`${host}`:`${port}`
* 查重(如果Excel表中的第一条存在数据库中,那么,这个Excel表将不会导入)

example

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目录路径)

Readme

Keywords

Package Sidebar

Install

npm i xlsx-to-mongo

Weekly Downloads

0

Version

1.0.3

License

MIT

Unpacked Size

4.39 kB

Total Files

6

Last publish

Collaborators

  • alfieri