[erlang-questions] Fwd: How to access CouchDB?

Yves S. Garret yoursurrogategod@REDACTED
Fri Aug 9 18:47:08 CEST 2013


Got it!  Thanks!

% erl -pz /very/long/path

---------- Forwarded message ----------
From: Yves S. Garret <yoursurrogategod@REDACTED>
Date: Thu, Aug 8, 2013 at 9:38 PM
Subject: How to access CouchDB?
To: "erlang-questions@REDACTED" <erlang-questions@REDACTED>


Hello,

I have a small database that's running right now in CouchDB, it's called
sample_database.  What I'd
like to do is to read, create, delete, update documents and run some of the
views inside from an
Erlang app.  I looked online and found this example:
http://www.softwarepassion.com/importing-data-to-couchdb-java-ruby-and-erlang-way/

>From that, I proceeded to make the following little script:
-module(test).

-import(queue,[in/1,out/1,new/0]).
-export([start/0]).
-include("../couch_db.hrl").

-define(ADMIN_USER_CTX, {user_ctx, #user_ctx{roles = [<<"_admin">>]}}).

start() ->
  io:format("Hello world!~n~n"),

  couch_db:open(<<"sample_database">>, [?ADMIN_USER_CTX]).

However, when I run this, I get the following error:
18> test:start().
Hello world!

** exception error: undefined function couch_db:open/2

It's obvious I'm not including a library of some sort.  I'm curious how I
can connect to my little
database in the simplest way possible just to start with.  Has anyone done
this before?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130809/9eaeef50/attachment.htm>


More information about the erlang-questions mailing list