Skip to content

Commit 076039f

Browse files
authored
Merge pull request #122 from raihanhbh/master
Proposed fix for mongo_tail replica_set incompatibility
2 parents 796b6ea + 023e192 commit 076039f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/fluent/plugin/in_mongo_tail.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,10 @@ def run
118118
private
119119

120120
def client
121-
@client_options[:database] = @database
121+
@client_options[:database] = @database if @database
122122
@client_options[:user] = @user if @user
123123
@client_options[:password] = @password if @password
124-
Mongo::Client.new(["#{node_string}"], @client_options)
124+
Mongo::Client.new(node_string, @client_options)
125125
end
126126

127127
def get_collection
@@ -133,7 +133,7 @@ def get_collection
133133
def node_string
134134
case
135135
when @database
136-
"#{@host}:#{@port}"
136+
["#{@host}:#{@port}"]
137137
when @url
138138
@url
139139
end

0 commit comments

Comments
 (0)