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