MongoDB\BSON\ObjectID::__constructConstruct a new ObjectID
&reftitle.description;
finalpublicMongoDB\BSON\ObjectID::__constructstringid
&reftitle.parameters;
id (string)
A 24-character hexadecimal string. If not provided, the driver will
generate an ObjectID.
&reftitle.errors;
&mongodb.throws.argumentparsing;
Throws MongoDB\Driver\Exception\InvalidArgumentException if id is not a 24-character hexadecimal string.
&reftitle.examples;
MongoDB\BSON\ObjectID::__construct example
]]>
&example.outputs.similar;
string(24) "56732d3dda14d81214634921"
}
object(MongoDB\BSON\ObjectID)#1 (1) {
["oid"]=>
string(24) "000000000000000000000001"
}
]]>
&reftitle.seealso;
ObjectID ReferenceBSON Types: ObjectID