1Mango::Protocol(3) User Contributed Perl Documentation Mango::Protocol(3)
2
3
4
6 Mango::Protocol - The MongoDB wire protocol
7
9 use Mango::Protocol;
10
11 my $protocol = Mango::Protocol->new;
12 my $bytes = $protocol->query(1, 'foo', {}, 0, 10, {}, {});
13
15 Mango::Protocol is a minimalistic implementation of the MongoDB wire
16 protocol.
17
19 Mango::Protocol inherits all methods from Mojo::Base and implements the
20 following new ones.
21
22 build_get_more
23 my $bytes = $protocol->build_get_more($id, $name, $return, $cursor);
24
25 Build message for "GET_MORE" operation.
26
27 build_kill_cursors
28 my $bytes = $protocol->build_kill_cursors($id, @ids);
29
30 Build message for "KILL_CURSORS" operation.
31
32 build_query
33 my $bytes = $protocol->build_query($id, $name, $flags, $skip, $return,
34 $query, $fields);
35
36 Build message for "QUERY" operation.
37
38 command_error
39 my $err = $protocol->command_error($doc);
40
41 Check document for command error.
42
43 next_id
44 my $id = $protocol->next_id(23);
45
46 Generate next id.
47
48 parse_reply
49 my $reply = $protocol->parse_reply(\$str);
50
51 Extract and parse "reply" message.
52
53 query_failure
54 my $err = $protocol->query_failure($reply);
55
56 Check reply for query failure.
57
58 write_error
59 my $err = $protocol->write_error($doc);
60
61 Check document for write error.
62
64 Mango, Mojolicious::Guides, <http://mojolicio.us>.
65
66
67
68perl v5.34.0 2021-07-22 Mango::Protocol(3)