[erlang-questions] How to access CouchDB?

Bengt Kleberg bengt.kleberg@REDACTED
Fri Aug 9 07:36:37 CEST 2013


Greetings,

Where is couch_db.beam located on your system?

The Erlang equivalent of including libraries is to do:
"erl -pz /path/to/beam_directory"

when starting Erlang.


bengt

On Thu, 2013-08-08 at 21:38 -0400, Yves S. Garret wrote:
> 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?
> 
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions




More information about the erlang-questions mailing list