@@ 120-122 (lines=3) @@ | ||
117 | $result = $this->getMongoCollection()->delete($id); |
|
118 | } |
|
119 | } |
|
120 | if ($result['ok'] !== (double) 1) { |
|
121 | throw new Exception('Error deleting file: ' . $result['err'] . ': ' . $result['errmsg']); |
|
122 | } |
|
123 | ||
124 | return $this; |
|
125 | } |
@@ 886-892 (lines=7) @@ | ||
883 | $result = $this->getMongoCollection()->insert($document); |
|
884 | ||
885 | // if write concern acknowledged |
|
886 | if (is_array($result)) { |
|
887 | if ($result['ok'] != 1) { |
|
888 | throw new Exception('Insert error: ' . $result['err'] . ': ' . $result['errmsg']); |
|
889 | } |
|
890 | ||
891 | return $this; |
|
892 | } |
|
893 | ||
894 | // if write concern unacknowledged |
|
895 | if (!$result) { |