All Projects → Moblox → Mongo Xlsx

Moblox / Mongo Xlsx

Licence: mit
Convert Mongo data into Excel and vice versa @ Node.js. MongoDB Mongoose Dump to excel.

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Mongo Xlsx

Blog By Nodejs
NodeJs + Mongoose + Express + jQuery + BootStrap + Ejs + Webpack搭建多人博客
Stars: ✭ 72 (-11.11%)
Mutual labels:  mongodb
Polled.win
📊 Real time polling
Stars: ✭ 76 (-6.17%)
Mutual labels:  mongodb
Laravel Permission Mongodb
Associate users with roles and permissions using Laravel and MongoDB
Stars: ✭ 80 (-1.23%)
Mutual labels:  mongodb
Mern Login Signup Component
Minimalistic Sessions based Authentication app 🔒 using Reactjs, Nodejs, Express, MongoDB and Bootstrap. Uses Cookies 🍪
Stars: ✭ 74 (-8.64%)
Mutual labels:  mongodb
Aus Search
A collection of Node JS scripts to create an Elasticsearch index of Australian addresses.
Stars: ✭ 76 (-6.17%)
Mutual labels:  mongodb
Runner
Start all mongodb deployment types for testing
Stars: ✭ 78 (-3.7%)
Mutual labels:  mongodb
Hydro
新一代高效强大的信息学在线测评系统
Stars: ✭ 70 (-13.58%)
Mutual labels:  mongodb
Parse Dashboard For Ios
A beautiful mobile client for managing your Parse apps while you are on the go! Now you can easily view and modify your data in the same way you would on the offical desktop client.
Stars: ✭ 81 (+0%)
Mutual labels:  mongodb
Node Oauth2 Server Mongo Example
Working oauth2 server with mongodb storage and minimal configuration
Stars: ✭ 76 (-6.17%)
Mutual labels:  mongodb
Djongo
Django and MongoDB database connector
Stars: ✭ 1,222 (+1408.64%)
Mutual labels:  mongodb
Typegoose
Typegoose - Define Mongoose models using TypeScript classes.
Stars: ✭ 1,189 (+1367.9%)
Mutual labels:  mongodb
Typerx
A lightweight typescript annotation rest based extra (express、 mongoose、 angular、zorro、ng-alain ...).
Stars: ✭ 76 (-6.17%)
Mutual labels:  mongodb
Cheatsheets
JavaScript and Node.js cheatsheets
Stars: ✭ 1,191 (+1370.37%)
Mutual labels:  mongodb
Lxhive
A lightweight Experience API Learning Record Store (LRS)
Stars: ✭ 73 (-9.88%)
Mutual labels:  mongodb
Typegoose
Typegoose - Define Mongoose models using TypeScript classes.
Stars: ✭ 1,232 (+1420.99%)
Mutual labels:  mongodb
Transporter
Sync data between persistence engines, like ETL only not stodgy
Stars: ✭ 1,175 (+1350.62%)
Mutual labels:  mongodb
Mern
🎉 This is boilerplate for MERN stack with integrations like Redux and SSR 🎉
Stars: ✭ 77 (-4.94%)
Mutual labels:  mongodb
Lua Mongo
MongoDB Driver for Lua
Stars: ✭ 81 (+0%)
Mutual labels:  mongodb
Koa2 Ratelimit
Rate-limiting middleware for Koa2 ES6. Use to limit repeated requests to APIs and/or endpoints such as password reset.
Stars: ✭ 81 (+0%)
Mutual labels:  mongodb
Weixin
微信小游戏辅助合集(加减大师、包你懂我、大家来找茬腾讯版、头脑王者、好友画我、悦动音符、我最在行、星途WeGoing、猜画小歌、知乎答题王、腾讯中国象棋、跳一跳、题多多黄金版)
Stars: ✭ 1,216 (+1401.23%)
Mutual labels:  mongodb

mongo-xlsx

IMPORTANT: Pre-ALPHA quality.

mongo-xlsx is a node.js utility module which provides tools that convert excel spreadsheets into/from MongoDB data. (MongoDB data -> Array of JSONs)

The general data conversion flow:

MongoDB -> (extract data w/MongooseModel.find) -> MongoData -> (convert w/mongoData2Xlsx) -> file.xlsx

file.xlsx -> (convert data w/xlsx2MongoData) -> MongoData -> (save to MongoDB w/mongoose.save) -> MongoDB

mongoData2Xlsx

[
  { 
    "name" : "eddie", 
    "likes" : [ "video games", "ninjas" ] 
  },
  { 
    "name" : "nico", 
    "likes" : [ "nyc" ], 
    "description" : { 
      "mascot" : "dog" 
    }
  }
]

converts to

name likes[0] likes[1] description[mascot]
eddie video games ninjas
nico nyc dog

xlsx2MongoData

Reverses the previous example (table -> json array)

Screenshots

Screenshots: spreedsheet <--> json

alt tag

Custom headers for writing and reading excel files:

alt tag Just define a model! Example

Quick Examples

var mongoXlsx = require('mongo-xlsx');

var data = [ { name : "Peter", lastName : "Parker", isSpider : true } , 
             { name : "Remy",  lastName : "LeBeau", powers : ["kinetic cards"] }];

/* Generate automatic model for processing (A static model should be used) */
var model = mongoXlsx.buildDynamicModel(data);

/* Generate Excel */
mongoXlsx.mongoData2Xlsx(data, model, function(err, data) {
  console.log('File saved at:', data.fullPath); 
});
/* Read Excel */
mongoXlsx.xlsx2MongoData("./file.xlsx", model, function(err, mongoData) {
  console.log('Mongo data:', mongoData); 
});
Name Email
Eddie [email protected]
Nico [email protected]
/* Read xlsx file without a model */
/* The library will use the first row the key */
var model = null;
var xlsx  = './file.xlsx';

mongoxlsx.xlsx2MongoData(xlsx, model, function(err, data) {
  console.log(data);
  /*
  [{ Name: 'Eddie', Email: '[email protected]' }, { Name: 'Nico', Email: '[email protected]' }]  
  */
});

Instalation

npm install mongo-xlsx

Testing

mocha

Models

A model is used for converting Excel into Mongo data. The model allows, to have custom headers for writing and reading Excel files.

[
 {
    "displayName": "User Identifier",
    "access": "_id",
    "type": "string"
  },
  {
    "displayName": "Main Index",
    "access": "index",
    "type": "number"
  }
]
displayName : Excel header name
access : Object key
type: Data Type 

A model can be automaticly build with:

buildDynamicModel(mongoData)

For example:

buildDynamicModel([{name:"eddie", age:40}, {name:"moe", age:19}, {name:"andrew", age:33} ])

gives:

[ { displayName: 'name', access: 'name', type: 'string' },
  { displayName: 'age', access: 'age', type: 'number' } ]  

Documentation

buildDynamicModel(mongoData)

Generates a Model for converting into/from Excel/MongoData. This can be used to create a static conversion model.

mongoData2Xlsx(monogData, mongoModel, [options], callback)

Converts MongoData into a Excel File

mongoData2XlsxMultiPage(excelDataArray, sheetNamesArray, [options], callback)

Converts an array of MongoData into a Excel file with multiple sheets

mongoData2XlsxData(mongoData, mongoModel)

Converts MongoData into Excel Data to allow merging into single Excel File

xlsx2MongoData(path, mongoModel, [options], callback)

Converts Excel File into Mongo Data. If mongoModel is null trys to use the file's header to build the JSON Otherwise the mongoModel map will be used to build the JSON

xlsxData2MongoData(excelData, mongoModel)

Converts Excel Data into Mongo Data. If mongoModel is null trys to use the file's header to build the JSON Otherwise the mongoModel map will be used to build the JSON

Roadmap

[Github issue] (https://github.com/Moblox/mongo-xlsx/issues/5)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].