I have the following code, and I want to know if there is any mongodb function that returns true or false depending on whether the query was executed correctly or not.
public function removepopup($id){
$collection = $this->connect()->deleteOne(['_id' => new MongoDB\BSON\ObjectID( $id )]);
}