arnings;
package CouchDB::Utils::App::Command::dump;
use App::Cmd::Setup -command;
use URI;
use JSON::XS;
use File::Path qw(mkpath);
use File::Spec::Functions qw(rel2abs catdir catfile);
use AnyEven
sub execute {
my ($self, $opt, $args) = @_;
## this will be used to pretty format json
my $json = JSON->new->allow_nonref->pretty;
my $name = $args->[0]; ## database name
## unspecified
=> $start, ids => \@ids };
}
## pretty json formating makes it easier to edit the docs once
## they are on the file system
my $pretty_doc = $json->encode($doc);
_dump(catfile($doc_dir,'do
ct;
use warnings;
package CouchDB::Utils::App::Command::load;
use App::Cmd::Setup -command;
use JSON;
use MIME::Base64;
use File::Basename;
use File::Slurp qw(read_file);
use File::Spec::Functions q
$uri->port($opt->{port});
$uri->path($name);
}
my $db = couchdb($uri->as_string);
my $json = JSON->new->allow_nonref->pretty;
my @docs;
opendir (my $dh, $path) || die $!;
while (my $f = r
my $doc_path = catfile($path, $id, 'doc');
open DOC, ">$doc_path" or die $!;
print DOC $json->encode($doc);
close DOC;
} elsif ($load->{error}) {
warn "$load->{id} $load->{error}: $