Skip to content

Commit 2c28b18

Browse files
Merge pull request #61 from regnerisch/master
2 parents 50fc208 + adc735f commit 2c28b18

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

src/Documents.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,20 @@ public function upsert(array $document, array $options = []): array
9898
*/
9999
public function update(array $document, array $options = []): array
100100
{
101-
return $this->apiCall->post(
101+
if (empty($options['filter_by'])) {
102+
return $this->apiCall->post(
103+
$this->endPointPath(''),
104+
$document,
105+
true,
106+
array_merge($options, ['action' => 'update'])
107+
);
108+
}
109+
110+
return $this->apiCall->patch(
102111
$this->endPointPath(''),
103112
$document,
104113
true,
105-
array_merge($options, ['action' => 'update'])
114+
$options
106115
);
107116
}
108117

0 commit comments

Comments
 (0)