NAME
Mango::Protocol - The MongoDB wire protocol
SYNOPSIS
use Mango::Protocol;
my $protocol = Mango::Protocol->new;
my $bytes = $protocol->insert(23, 'foo.bar', {}, {foo => 'bar'});
DESCRIPTION
Mango::Protocol is a minimalistic implementation of the MongoDB wire protocol.
METHODS
Mango::Protocol inherits all methods from Mojo::Base and implements the following new ones.
build_delete
my $bytes = $protocol->build_delete($id, $name, $flags, $query);
Build packet for delete
operation.
build_get_more
my $bytes = $protocol->build_get_more($id, $name, $limit, $cursor);
Build packet for get_more
operation.
build_insert
my $bytes = $protocol->build_insert($id, $name, $flags, @docs);
Build packet for insert
operation.
build_kill_cursors
my $bytes = $protocol->build_kill_cursors($id, @ids);
Build packet for kill_cursors
operation.
build_query
my $bytes = $protocol->build_query($id, $name, $flags, $skip, $limit,
$query, $fields);
Build packet for query
operation.
build_update
my $bytes = $protocol->build_update($id, $name, $flags, $query, $update);
Build packet for update
operation.
parse_reply
my $reply = $protocol->parse_reply(\$string);
Extract and parse reply
packet.