We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 243d1ec commit bf7b610Copy full SHA for bf7b610
lib/mongo/operation/write/bulk/bulk_update/result.rb
@@ -149,7 +149,11 @@ def n_matched
149
private
150
151
def upsert?(reply)
152
- !reply.documents.first[UPDATED_EXISTING]
+ !updated_existing?(reply) && reply.documents.first[N] == 1
153
+ end
154
+
155
+ def updated_existing?(reply)
156
+ reply.documents.first[UPDATED_EXISTING]
157
end
158
159
lib/mongo/operation/write/update/result.rb
@@ -147,7 +147,7 @@ def upserted_id
147
148
def upsert?
- !updated_existing?
+ !updated_existing? && n == 1
def updated_existing?
0 commit comments