AnyMongo - Asynchronous non-blocking MongoDB driver for AnyEvent applications
version 0.03
use AnyMongo; my $connection = AnyMongo::new_connection(host => 'mongodb://localhost:27017'); my $database = $connection->get_database('foo'); my $collection = $database->get_collection('bar'); my $id = $collection->insert({ some => 'data' }); my $data = $collection->find_one({ _id => $id }); # AnyMongo also can run in official MongoDB compatible mode, # Then you can run your old code depends on mongoDB quickly use AnyMongo::Compat; # now AnyMongo will mock most MongoDB package my $con = MongoDB::Connection->new(host => 'mongodb://localhost'); my $db = $con->get_database('foo');
You can try AnyMongo::Compat, this wrapper package try to make compatible with MongoDB as possible.
See INSTALL.
You must check MongoDB, because most code of AnyMongo just stolen from it.
Pan Fan(nightsailer) <nightsailer at gmail.com>
Kristina Chodorow <kristina at 10gen.com>
This software is copyright (c) 2010 by Pan Fan(nightsailer).
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install AnyMongo, copy and paste the appropriate command in to your terminal.
cpanm
cpanm AnyMongo
CPAN shell
perl -MCPAN -e shell install AnyMongo
For more information on module installation, please visit the detailed CPAN module installation guide.