(No version information available, might only be in Git)
Collection::removeOne — Remove one collection document
$id
)
Remove one document from the collection with the correspending ID.
This is a shortcut for Collection.remove("_id = :id").bind("id", id).execute()
.
id
The ID of the collection document to remove.
A Result object that can be used to query the number of affected items or the number warnings generated by the operation.
Example #1 mysql_xdevapi\Collection::removeOne() example
<?php
// Assuming $coll is a valid collection object
$res = $coll->removeOne('00005ad66abf0001000400000003');
if( $res->getAffectedItemsCount() == 0 ) {
print('The document with ID 00005ad66abf0001000400000003 seems to not exists, nothing was removed');
}
?>