|
NAMEMango::BSON::ObjectID - Object ID typeSYNOPSISuse Mango::BSON::ObjectID; my $oid = Mango::BSON::ObjectID->new('1a2b3c4e5f60718293a4b5c6'); say $oid->to_epoch; DESCRIPTIONMango::BSON::ObjectID is a container for the BSON object id type used by Mango::BSON.METHODSMango::BSON::ObjectID inherits all methods from Mojo::Base and implements the following new ones.from_epochmy $oid = $oid->from_epoch(1359840145); Generate new object id with specific epoch time. newmy $oid = Mango::BSON::ObjectID->new; my $oid = Mango::BSON::ObjectID->new('1a2b3c4e5f60718293a4b5c6'); Construct a new Mango::BSON::ObjectID object. to_bytesmy $bytes = $oid->to_bytes; Object id in binary form. to_epochmy $epoch = $oid->to_epoch; Extract epoch seconds from object id. to_stringmy $str = $oid->to_string; Stringify object id. OPERATORSMango::BSON::ObjectID overloads the following operators.boolmy $bool = !!$oid; Always true. stringifymy $str = "$oid"; Alias for "to_string". SEE ALSOMango, Mojolicious::Guides, <http://mojolicio.us>.
Visit the GSP FreeBSD Man Page Interface. |