MongoDB\BSON\ObjectId::__constructConstruit un nouvel ObjectId
&reftitle.description;
finalpublicMongoDB\BSON\ObjectId::__constructstringid
&reftitle.parameters;
id (string)
Une chaîne héxadécimale de 24 caractères. Si elle n'est pas fournie, le driver
génèrera un ObjectId.
&reftitle.errors;
&mongodb.throws.argumentparsing;
Lance une exception MongoDB\Driver\Exception\InvalidArgumentException
si id n'est pas une chaîne héxadécimale de 24 caractères.
&reftitle.examples;
Exemple avec MongoDB\BSON\ObjectId::__construct
]]>
&example.outputs.similar;
string(24) "56732d3dda14d81214634921"
}
object(MongoDB\BSON\ObjectId)#1 (1) {
["oid"]=>
string(24) "000000000000000000000001"
}
]]>
&reftitle.seealso;
La référence ObjectIdLe type BSON : ObjectId