Adam Taylor > Dancer-Plugin-Mongo-0.03 > Dancer::Plugin::Mongo

Download:
Dancer-Plugin-Mongo-0.03.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Module Version: 0.03   Source  

NAME ^

Dancer::Plugin::Mongo - MongoDB plugin for the Dancer micro framework

VERSION ^

version 0.03

SYNOPSIS ^

    use Dancer;
    use Dancer::Plugin::Mongo;

    get '/widget/view/:id' => sub {
        my $widget = mongo->database->collection->find_one({ id => params->{id} });
    }

DESCRIPTION ^

Dancer::Plugin::Mongo provides a wrapper around MongoDB. Add the appropriate configuraton options to your config.yml and then you can access a MongoDB database using the 'mongo' keyword.

To query the database, use the standard MongoDB syntax, described in MongoDB::Collection.

CONFIGURATON ^

Connection details will be taken from your Dancer application config file, and should be specified as follows:

    plugins:
        Mongo:
            host:
            port:
            username:
            password:
            w:
            wtimeout:
            auto_reconnect:
            auto_connect:
            timeout:
            db_name:
            query_timeout:
            find_master:

All these configuration values are optional, full details are in the MongoDB::Connection documentation.

AUTHOR ^

Adam Taylor <ajct@cpan.org>

COPYRIGHT AND LICENSE ^

This software is copyright (c) 2010 by Adam Taylor.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

syntax highlighting: