Skip to content

Commit

Permalink
feat: force set upsert to false when use method ReplaceOne (#294)
Browse files Browse the repository at this point in the history
  • Loading branch information
javasgl authored Jun 11, 2023
1 parent 4199644 commit ec9b0af
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ func (c *Collection) ReplaceOne(ctx context.Context, filter interface{}, doc int
if len(opts) > 0 {
if opts[0].ReplaceOptions != nil {
replaceOpts = opts[0].ReplaceOptions
replaceOpts.SetUpsert(false)
}
if opts[0].UpdateHook != nil {
h = opts[0].UpdateHook
Expand Down

0 comments on commit ec9b0af

Please sign in to comment.