Skip to content

Commit 9362e8e

Browse files
committed
bulk update without array key
1 parent 95ebd30 commit 9362e8e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Classes/Bulk.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,11 @@ public function action($actionType, $data = [])
193193
];
194194

195195
if (!empty($data)) {
196-
$this->body["body"][] = $data;
196+
if($actionType == "update"){
197+
$this->body["body"][] = ["doc" => $data];
198+
}else {
199+
$this->body["body"][] = $data;
200+
}
197201
}
198202

199203
$this->operationCount++;
@@ -239,7 +243,7 @@ public function commit()
239243
if (empty($this->body)) {
240244
return false;
241245
}
242-
246+
243247
$result = $this->query->connection->bulk($this->body);
244248
$this->operationCount = 0;
245249
$this->body = [];

0 commit comments

Comments
 (0)