Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Kelp::Module::MongoDB - Use MongoDB within Kelp
Perl
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib/Kelp/Module
t
.gitignore
.travis.yml
Build.PL
Changes
LICENSE
META.json
README.md
cpanfile
dist.ini

README.md

NAME

Kelp::Module::MongoDB - Use MongoDB within Kelp

DESCRIPTION

Kelp::Module::MongoDB is a Kelp plugin.

SYNOPSIS

First ...

  # conf/config.pl
{
      modules      => ['MongoDB'],
      modules_init => {
          MongoDB => {
              host => 'localhost',           # example
              port => 27017,                 # example
          }
      }
  }

Then ...

package MyApp;
use Kelp::Base 'Kelp';

sub some_route {
    my $self       = shift;
    my $db         = $self->mongodb->get_database('foodb');
    my $collection = $db->get_collection('bar');
    my $id         = $collection->insert({some => 'data'});
    my $data       = $collection->find_one({_id => $id});
}

METHODS

This module registers only one method into the application: mongodb. It is an instance of a MongoDB class.

AUTHOR

Adam Stokes adamjs@cpan.org

COPYRIGHT

Copyright 2013- Adam Stokes

LICENSE

Licensed under the same terms as Perl.

SEE ALSO

Kelp.

Something went wrong with that request. Please try again.