GoLang MongoDB\BSON\ObjectId::__toString

request it (95)
GoLang replacement for PHP's MongoDB\BSON\ObjectId::__toString [edit | history]



Do you know a GoLang replacement for PHP's MongoDB\BSON\ObjectId::__toString? Write it!

PHP MongoDB\BSON\ObjectId::__toString

PHP original manual for MongoDB\BSON\ObjectId::__toString [ show | php.net ]

MongoDB\BSON\ObjectId::__toString

(mongodb >=1.0.0)

MongoDB\BSON\ObjectId::__toStringReturns the hexidecimal representation of this ObjectId

Description

final public string MongoDB\BSON\ObjectId::__toString ( void )

Parameters

This function has no parameters.

Return Values

Returns the hexidecimal representation of this ObjectId.

Errors/Exceptions

Examples

Example #1 MongoDB\BSON\ObjectId::__toString() example

<?php

var_dump
((string) new MongoDB\BSON\ObjectId());
var_dump((string) new MongoDB\BSON\ObjectId('000000000000000000000001'));

?>

The above example will output something similar to:

string(24) "56731b49da14d8747d701211"
string(24) "000000000000000000000001"