|
@@ 131-138 (lines=8) @@
|
| 128 |
|
return false; |
| 129 |
|
} |
| 130 |
|
|
| 131 |
|
public function remove($criteria = array(), array $options = array(), $collectionName) |
| 132 |
|
{ |
| 133 |
|
$namespace = $this->db_name.'.'.$collectionName; |
| 134 |
|
$dbWrite = new \MongoDB\Driver\BulkWrite(); |
| 135 |
|
$dbWrite->delete($criteria); |
| 136 |
|
$res = $this->manager->executeBulkWrite($namespace, $dbWrite, $options); |
| 137 |
|
return $res->getDeletedCount() >= 1; |
| 138 |
|
} |
| 139 |
|
|
| 140 |
|
public function update($criteria, $new_object, $options = array(), $collectionName) |
| 141 |
|
{ |
|
@@ 140-147 (lines=8) @@
|
| 137 |
|
return $res->getDeletedCount() >= 1; |
| 138 |
|
} |
| 139 |
|
|
| 140 |
|
public function update($criteria, $new_object, $options = array(), $collectionName) |
| 141 |
|
{ |
| 142 |
|
$namespace = $this->db_name.'.'.$collectionName; |
| 143 |
|
$dbWrite = new \MongoDB\Driver\BulkWrite(); |
| 144 |
|
$dbWrite->update($criteria, $new_object, $options); |
| 145 |
|
$res = $this->manager->executeBulkWrite($namespace, $dbWrite, $options); |
| 146 |
|
return $res->getModifiedCount() === 1; |
| 147 |
|
} |
| 148 |
|
|
| 149 |
|
public function count($query = array(), $options = array(), $collectionName) |
| 150 |
|
{ |