Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Starting with Node.js and CouchDB without libraries like nano or cradle [duplicate]

Possible Duplicate:
Getting ' bad_request invalid_json' error when trying to insert document into CouchDB from Node.js

The highest voted answer on CouchDB and Node.js - What module do you recommend? recommends not to use libraries such as nano or cradle for starting with Node.js and CouchDB.

However I haven't found any tutorial on how to perform standard operations for all DBMSes like create database, create table, add and view data etc. programmatically.

EDIT: (partial answer) after installing and starting CouchDB go to http://localhost:5984/_utils/script/couch.js.

like image 649
DSblizzard Avatar asked Jul 25 '12 07:07

DSblizzard


1 Answers

You should start by reading the CouchDB book.

No idea why you don't want to use a module: I think you took an answer out of context (an answer that is probably one year old) and made your decision not to use a module.

That is not likely to be helpful to get stuff done. :) You are just repeating work that is done, and issues that have been fixed, etc.

If you want to learn CouchDB, read the book. You can read nano's source as it maps really closely to the API and should be easy to read, but the book is the full way to go.

If by any reason you decide you still want to implement your own module to do what others already do well, go for it :)

If instead you are looking for resources on using nano there are quite a few:

  • readme: github
  • screencast: couchdb and nano
  • article: nano - a minimalistic couchdb client for nodejs
  • article: getting started with node.js and couchdb
  • article: document update handler support
  • article: nano 3
  • article: securing a site with couchdb cookie authentication using node.js and nano
  • article: adding copy to nano
  • article: how to update a document with nano
  • article: mock http integration testing in node.js using nock and specify
  • article: mock testing couchdb in node.js with nock and tap
like image 191
dscape Avatar answered Sep 23 '22 20:09

dscape