Net::CouchDb - Interface to CouchDb
Please note this module is no longer maintained. I recommend you use CouchDB::Client instead (or AnyEvent::CouchDB if that is closer to your needs).
Provides an object oriented interface to the CouchDb REST/JSON API.
use Net::CouchDb; my $cdb = Net::CouchDb->new(host => "localhost", port => 5984); $cdb->debug(1); $cdb->create_db("test"); my $test = $cdb->db("test"); my $doc = $test->new_doc; $doc->colours = [qw(blue green orange)]; $doc->create;
Creates a new Net::CouchDb object. Takes the following parameters:
host: Hostname of server (defaults to localhost).
port: Port of server (defaults to 5984).
uri: Optionally specify a URI instead of host and port. (e.g. http://localhost:5984).
conn_cache: Either provide a LWP::ConnCache object to cache connections to CouchDb, or set to 0 to disable connection caching. If not supplied Net::CouchDb will automatically use a per-instance cache.
Open/connect to a specific database. Returns a Net::CouchDb::Database object.
Alias for db.
Create a new database.
Return a list of all databases
Delete a database.
Returns a data structure with the information from the couchdb "/" URI (notably the version).
Set or get the debug flag (defaults to 0, higher values gives more debug output). This requires that the Data::Dump module is installed.
This can also be enabled via the COUCH_DEBUG environment variable.
COUCH_DEBUG
Log a debug message at debug_level.
debug_level
Make a REST/JSON call. Normally you should use a more specific method, but this provides low-level access if needed.
$method is the HTTP method to use.
$uri is the HTTP URI to request.
$data is a reference which will be converted to JSON data if the request expects one. For a GET request it is converted into URI parameters.
Returns a reference to the returned JSON data in scalar context, in array context returns the HTTP status and the reference.
Return the URI that this instance is pointing at.
David Leadbeater, <dgl at dgl dot cx>
<dgl at dgl dot cx>
Please report any bugs or feature requests to bug-net-couchdb at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-CouchDb. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-net-couchdb at rt.cpan.org
There is a git repository available at git://code.d.cx/Net-CouchDb, which can be viewed at http://code.d.cx/?p=Net-CouchDb.git.
Copyright 2007 David Leadbeater, all rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
To install Net::CouchDb, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::CouchDb
CPAN shell
perl -MCPAN -e shell install Net::CouchDb
For more information on module installation, please visit the detailed CPAN module installation guide.