Skip to content

Commit 8fca4e9

Browse files
committed
Rename mode -> action
1 parent ccee923 commit 8fca4e9

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

examples/collection_operations.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,15 @@
180180
echo "--------Upsert Documents-------\n";
181181
$upsertRes =
182182
$client->collections['books']->documents->import($docsToImport, [
183-
'mode' => 'upsert'
183+
'action' => 'upsert'
184+
]);
185+
print_r($upsertRes);
186+
echo "--------Upsert Documents-------\n";
187+
echo "\n";
188+
echo "--------Update Documents-------\n";
189+
$upsertRes =
190+
$client->collections['books']->documents->import($docsToImport, [
191+
'action' => 'update'
184192
]);
185193
print_r($upsertRes);
186194
echo "--------Upsert Documents-------\n";

src/Documents.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function create(array $document): array
7373
*/
7474
public function upsert(array $document): array
7575
{
76-
return $this->apiCall->post($this->endPointPath(''), $document, true, ['mode' => 'upsert']);
76+
return $this->apiCall->post($this->endPointPath(''), $document, true, ['action' => 'upsert']);
7777
}
7878

7979
/**
@@ -84,7 +84,7 @@ public function upsert(array $document): array
8484
*/
8585
public function update(array $document): array
8686
{
87-
return $this->apiCall->post($this->endPointPath(''), $document, true, ['mode' => 'update']);
87+
return $this->apiCall->post($this->endPointPath(''), $document, true, ['action' => 'update']);
8888
}
8989

9090
/**

0 commit comments

Comments
 (0)