Skip to content

Commit 5facd95

Browse files
author
Karim Alibhai
committed
Add: upsertCount to updateMany result
1 parent a3b177c commit 5facd95

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

mongo/collection.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,7 @@ func (coll *Collection) UpdateMany(ctx context.Context, filter interface{}, upda
611611
res := &UpdateResult{
612612
MatchedCount: r.MatchedCount,
613613
ModifiedCount: r.ModifiedCount,
614+
UpsertedCount: int64(len(r.Upserted)),
614615
}
615616
// TODO(skriptble): Is this correct? Do we only return the first upserted ID for an UpdateMany?
616617
if len(r.Upserted) > 0 {

0 commit comments

Comments
 (0)