Mango::Protocol - The MongoDB wire protocol
use Mango::Protocol; my $protocol = Mango::Protocol->new; my $bytes = $protocol->insert(23, 'foo.bar', {}, {foo => 'bar'});
Mango::Protocol is a minimalistic implementation of the MongoDB wire protocol.
Mango::Protocol inherits all methods from Mojo::Base and implements the following new ones.
my $bytes = $protocol->build_delete($id, $name, $flags, $query);
Build message for delete operation.
delete
my $bytes = $protocol->build_get_more($id, $name, $return, $cursor);
Build message for get_more operation.
get_more
my $bytes = $protocol->build_insert($id, $name, $flags, @docs);
Build message for insert operation.
insert
my $bytes = $protocol->build_kill_cursors($id, @ids);
Build message for kill_cursors operation.
kill_cursors
my $bytes = $protocol->build_query($id, $name, $flags, $skip, $return, $query, $fields);
Build message for query operation.
query
my $bytes = $protocol->build_update($id, $name, $flags, $query, $update);
Build message for update operation.
update
my $err = $protocol->command_error($reply);
Check reply for command error.
my $id = $protocol->next_id(23);
Generate next id.
my $reply = $protocol->parse_reply(\$str);
Extract and parse reply message.
reply
my $err = $protocol->query_failure($reply);
Check reply for query failure.
Mango, Mojolicious::Guides, http://mojolicio.us.
To install Mango, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mango
CPAN shell
perl -MCPAN -e shell install Mango
For more information on module installation, please visit the detailed CPAN module installation guide.