Mango::Protocol(3pm)
π Mango::Protocol π
okay bestie, welcome to Mango::Protocol β this is the MongoDB wire protocol, the 3pm Perl doc version, and yes she's minimalistic and yes she's iconic. periodt β¨
πΈ SYNOPSIS πΈ
like, here's the vibe, copy it exactly okay:
use Mango::Protocol;
my $protocol = Mango::Protocol->new;
my $bytes = $protocol->query(1, 'foo', {}, 0, 10, {}, {});
π¦ DESCRIPTION π¦
Mango::Protocol is a minimalistic implementation of the MongoDB wire protocol. that's it, that's the whole girl. she does one thing and she does it well, no cap π
π METHODS π
so Mango::Protocol inherits all the methods from Mojo::Base (love that for her) and then she implements these brand new ones below. slay.
π build_get_more
my $bytes = $protocol->build_get_more($id, $name, $return, $cursor);
Builds the message for the GET_MORE operation. π«
π build_kill_cursors
my $bytes = $protocol->build_kill_cursors($id, @ids);
Builds the message for the KILL_CURSORS operation. bye bye cursors π«Ά
π build_query
my $bytes = $protocol->build_query($id, $name, $flags, $skip, $return,
$query, $fields);
Builds the message for the QUERY operation. the main character of message-building fr fr π₯
π command_error
my $err = $protocol->command_error($doc);
Checks a document for a command error. π
π next_id
my $id = $protocol->next_id(23);
Generates the next id. β¨
π parse_reply
my $reply = $protocol->parse_reply(\$str);
Extracts and parses the reply message. π
π query_failure
my $err = $protocol->query_failure($reply);
Checks a reply for a query failure. π
π write_error
my $err = $protocol->write_error($doc);
Checks a document for a write error. π
π SEE ALSO π
- Mango
- Mojolicious::Guides
- <http://mojolicio.us>
and that's the whole page bestie π this lil cutie is Mango::Protocol, documented under perl v5.30.3, dated 2020-06-05, and she ate. go build some wire protocol messages, ily πβ¨π¦
π¦ where this page comes from
- debian bookworm: libmango-perl 1.30-2 Β· Artistic-2.0
- debian trixie: libmango-perl 1.30-2 Β· Artistic-2.0
- ubuntu jammy: libmango-perl 1.30-2 Β· Artistic-2.0
- ubuntu noble: libmango-perl 1.30-2 Β· Artistic-2.0
- ubuntu resolute: libmango-perl 1.30-2 Β· Artistic-2.0
- ubuntu stonking: libmango-perl 1.30-2 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms