|
NAMEMango::Protocol - The MongoDB wire protocol SYNOPSIS use Mango::Protocol;
my $protocol = Mango::Protocol->new;
my $bytes = $protocol->query(1, 'foo', {}, 0, 10, {}, {});
DESCRIPTIONMango::Protocol is a minimalistic implementation of the MongoDB wire protocol. METHODSMango::Protocol inherits all methods from Mojo::Base and implements the following new ones. build_get_moremy $bytes = $protocol->build_get_more($id, $name, $return, $cursor); Build message for "GET_MORE" operation. build_kill_cursorsmy $bytes = $protocol->build_kill_cursors($id, @ids); Build message for "KILL_CURSORS" operation. build_query my $bytes = $protocol->build_query($id, $name, $flags, $skip, $return,
$query, $fields);
Build message for "QUERY" operation. command_errormy $err = $protocol->command_error($doc); Check document for command error. next_idmy $id = $protocol->next_id(23); Generate next id. parse_replymy $reply = $protocol->parse_reply(\$str); Extract and parse "reply" message. query_failuremy $err = $protocol->query_failure($reply); Check reply for query failure. write_errormy $err = $protocol->write_error($doc); Check document for write error. SEE ALSOMango, Mojolicious::Guides, <http://mojolicio.us>.
|