Skip to content

Commit 01c0dbe

Browse files
Bug fix for RUBY-778 array error with Bulk API
1 parent da29ab7 commit 01c0dbe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/mongo/bulk_write_collection_view.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ def merge_result(errors, exchanges)
294294
elsif op_type == :update
295295
n_upserted = 0
296296
if (upserted = response.fetch("upserted", nil)) # assignment
297-
upserted = [{"_id" => upserted}] if upserted.class == BSON::ObjectId # OP_UPDATE non-array
297+
upserted = [{"_id" => upserted}] if upserted.class != Array # OP_UPDATE non-array
298298
n_upserted = upserted.size
299299
concat(result, "upserted", merge_indexes(upserted, exchange))
300300
end

0 commit comments

Comments
 (0)