Skip to content

Commit 243d1ec

Browse files
committed
#upsert? on update legacy result is true if updated_existing is false
1 parent 18fd1bc commit 243d1ec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/mongo/operation/write/update/result.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,13 @@ def modified_count
141141
#
142142
# @since 2.0.0
143143
def upserted_id
144-
upsert?
144+
first[UPSERTED] if upsert?
145145
end
146146

147147
private
148148

149149
def upsert?
150-
first[UPSERTED]
150+
!updated_existing?
151151
end
152152

153153
def updated_existing?

0 commit comments

Comments
 (0)