Skip to content

Commit

Permalink
change mongo logging policy to upsert (update by default, insert if new)
Browse files Browse the repository at this point in the history
  • Loading branch information
juananpe committed Aug 28, 2020
1 parent 6cf1b67 commit 4dc0441
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/logging/mongodb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def out(target, status, results)
else
Helper::utf8_elements!(foo) # convert foo to utf-8
flatten_elements!(foo)
@coll.insert_one(foo)
@coll.replace_one({ target: foo[:target]}, foo, { upsert: true})
end
end
end

0 comments on commit 4dc0441

Please sign in to comment.