|
12 | 12 | namespace EventEngine\Persistence; |
13 | 13 |
|
14 | 14 | use EventEngine\DocumentStore\DocumentStore; |
| 15 | +use EventEngine\DocumentStore\Exception\RuntimeException; |
| 16 | +use EventEngine\DocumentStore\Exception\UnknownCollection; |
15 | 17 | use EventEngine\DocumentStore\Filter\Filter; |
16 | 18 | use EventEngine\DocumentStore\Index; |
17 | 19 | use EventEngine\DocumentStore\OrderBy\OrderBy; |
@@ -140,6 +142,30 @@ public function upsertDoc(string $collectionName, string $docId, array $docOrSub |
140 | 142 | $this->documentStore->upsertDoc($collectionName, $docId, $docOrSubset); |
141 | 143 | } |
142 | 144 |
|
| 145 | + /** |
| 146 | + * @param string $collectionName |
| 147 | + * @param string $docId |
| 148 | + * @param array $doc |
| 149 | + * @throws UnknownCollection |
| 150 | + * @throws RuntimeException if updating did not succeed |
| 151 | + */ |
| 152 | + public function replaceDoc(string $collectionName, string $docId, array $doc): void |
| 153 | + { |
| 154 | + $this->documentStore->replaceDoc($collectionName, $docId, $doc); |
| 155 | + } |
| 156 | + |
| 157 | + /** |
| 158 | + * @param string $collectionName |
| 159 | + * @param Filter $filter |
| 160 | + * @param array $set |
| 161 | + * @throws UnknownCollection |
| 162 | + * @throws RuntimeException in case of connection error or other issues |
| 163 | + */ |
| 164 | + public function replaceMany(string $collectionName, Filter $filter, array $set): void |
| 165 | + { |
| 166 | + $this->documentStore->replaceMany($collectionName, $filter, $set); |
| 167 | + } |
| 168 | + |
143 | 169 | /** |
144 | 170 | * @param string $collectionName |
145 | 171 | * @param string $docId |
|
0 commit comments