1Mango::BSON::ObjectID(3U)ser Contributed Perl DocumentatiMoanngo::BSON::ObjectID(3)
2
3
4

NAME

6       Mango::BSON::ObjectID - Object ID type
7

SYNOPSIS

9         use Mango::BSON::ObjectID;
10
11         my $oid = Mango::BSON::ObjectID->new('1a2b3c4e5f60718293a4b5c6');
12         say $oid->to_epoch;
13

DESCRIPTION

15       Mango::BSON::ObjectID is a container for the BSON object id type used
16       by Mango::BSON.
17

METHODS

19       Mango::BSON::ObjectID inherits all methods from Mojo::Base and
20       implements the following new ones.
21
22   from_epoch
23         my $oid = $oid->from_epoch(1359840145);
24
25       Generate new object id with specific epoch time.
26
27   new
28         my $oid = Mango::BSON::ObjectID->new;
29         my $oid = Mango::BSON::ObjectID->new('1a2b3c4e5f60718293a4b5c6');
30
31       Construct a new Mango::BSON::ObjectID object.
32
33   to_bytes
34         my $bytes = $oid->to_bytes;
35
36       Object id in binary form.
37
38   to_epoch
39         my $epoch = $oid->to_epoch;
40
41       Extract epoch seconds from object id.
42
43   to_string
44         my $str = $oid->to_string;
45
46       Stringify object id.
47

OPERATORS

49       Mango::BSON::ObjectID overloads the following operators.
50
51   bool
52         my $bool = !!$oid;
53
54       Always true.
55
56   stringify
57         my $str = "$oid";
58
59       Alias for "to_string".
60

SEE ALSO

62       Mango, Mojolicious::Guides, <http://mojolicio.us>.
63
64
65
66perl v5.32.1                      2021-01-27          Mango::BSON::ObjectID(3)
Impressum