Code Monkey home page Code Monkey logo

csv2couchbase's Introduction

csv2couchbase

Import CSV files in Couchbase

Don't expect to much from this library. If you wish to see any other features - feel free to fork / contribute and push.

Installation

  1. Install node.js.
  2. Do npm install csv2couchbase.

Usage

csv2couchbase --csv path/to/csv
              [--host hostname] 
              [--password password]
              [--bucket bucket]
              [--queryhost queryhost]
              [--columns "col1,col2,col3"]
              [--autocolumns]
              [--pick "col1,col3"]
              [--omit "col2"]
              [--chunksize 1000]
              [--doctype doctype]
              [--simulate]

Command line options

  • --csv path/to/csv - specify path to csv file
  • --host hostname, --password password, --bucket bucket, --queryhost queryhost - see coachbase documentation
  • --columns "col1,col2,col3" - specify name of the columns in CSV file, in other case data will be imported as array of values.
  • --autocolumns - set this flag is columns can be autodiscovered in the first CSV line.
  • --pick "col1,col3" - specify which columns you want to include.
  • --omit "col2" - other way of omitting columns which you don't want to import.
  • --chunksize - default chunk size is 1000, script uses addMulti to import data by chunks.
  • --doctype - specify doctype property for each object. Also this value will be used to construct id for rows {doctype}_{index}.
  • --simulate - don't import anything to Couchbase, just simulate reading and print output to console.

Example

If you want to import GeoLite Country csv file

csv2couchbase --csv ~/Desktop/GeoIPCountryWhois.csv --bucket default --doctype geoip --columns "ip_from,ip_to,ip_int_from,ip_int_to,country_short,country"

csv2couchbase's People

Contributors

outcoldman avatar

Watchers

 avatar  avatar  avatar

Forkers

evengers pauldx

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.