From your comments it sounds like you want to use a GUID
as the _id
for the document, but you haven't shown us what fields are actually being inserted by the PHP code.
Assuming that is the case though, your PHP code will need to insert the _id
as a GUID
explicitly, otherwise the PHP driver will automatically set the _id
field to a generated ObjectId
.
$collection->insert(array(
"_id" => new MongoBinData($guid, 3)
));
should set the _id
to a GUID
instead of the default ObjectId
.