lib/pupa/processor/connection_adapters/mongodb_adapter.rb in pupa-0.2.1 vs lib/pupa/processor/connection_adapters/mongodb_adapter.rb in pupa-0.2.2
- old
+ new
@@ -9,10 +9,10 @@
# @param [String] database_url the database URL
def initialize(database_url)
uri = URI.parse(database_url)
@raw_connection = Mongo::Client.new(["#{uri.host}:#{uri.port}"], database: uri.path[1..-1])
- @raw_connection.login(uri.user, uri.password) if uri.user && uri.password
+ @raw_connection = @raw_connection.with(user: uri.user, password: uri.password) if uri.user && uri.password
end
# Finds a document matching the selection criteria.
#
# The selection criteria *must* set a `_type` key in order to determine