@@ -95,10 +95,10 @@ defmodule Mongo.MongoDBConnection do
95
95
end
96
96
97
97
@ impl true
98
- def handle_execute ( % Mongo.Query { action: action } = query , params , opts , original_state ) do
98
+ def handle_execute ( % Mongo.Query { action: action } = query , _params , opts , original_state ) do
99
99
tmp_state = % { original_state | database: Keyword . get ( opts , :database , original_state . database ) }
100
100
101
- with { :ok , reply , tmp_state } <- execute_action ( action , params , opts , tmp_state ) do
101
+ with { :ok , reply , tmp_state } <- send_command ( action , opts , tmp_state ) do
102
102
{ :ok , query , reply , Map . put ( tmp_state , :database , original_state . database ) }
103
103
end
104
104
end
@@ -264,7 +264,7 @@ defmodule Mongo.MongoDBConnection do
264
264
##
265
265
# Executes a hello or the legacy hello command
266
266
##
267
- defp execute_action ( { :exec_hello , cmd } , _params , opts , % { use_op_msg: true } = state ) do
267
+ defp send_command ( { :exec_hello , cmd } , opts , % { use_op_msg: true } = state ) do
268
268
db = opts [ :database ] || state . database
269
269
timeout = Keyword . get ( opts , :timeout , state . timeout )
270
270
flags = Keyword . get ( opts , :flags , 0x0 )
@@ -297,7 +297,7 @@ defmodule Mongo.MongoDBConnection do
297
297
##
298
298
# Executes a more to come command
299
299
##
300
- defp execute_action ( :command , [ : more_to_come] , opts , % { use_op_msg: true } = state ) do
300
+ defp send_command ( : more_to_come, opts , % { use_op_msg: true } = state ) do
301
301
event = % MoreToComeEvent { command: :more_to_come , command_name: opts [ :command_name ] || :more_to_come }
302
302
303
303
timeout = Keyword . get ( opts , :timeout , state . timeout )
@@ -313,7 +313,7 @@ defmodule Mongo.MongoDBConnection do
313
313
end
314
314
end
315
315
316
- defp execute_action ( :command , [ cmd ] , opts , % { use_op_msg: true } = state ) do
316
+ defp send_command ( { :command , cmd } , opts , % { use_op_msg: true } = state ) do
317
317
{ command_name , data } = provide_cmd_data ( cmd )
318
318
db = opts [ :database ] || state . database
319
319
cmd = cmd ++ [ "$db": db ]
@@ -350,7 +350,7 @@ defmodule Mongo.MongoDBConnection do
350
350
end
351
351
end
352
352
353
- defp execute_action ( :command , [ cmd ] , opts , state ) do
353
+ defp send_command ( { :command , cmd } , opts , state ) do
354
354
[ { command_name , _ } | _ ] = cmd
355
355
356
356
event = % CommandStartedEvent {
@@ -376,7 +376,7 @@ defmodule Mongo.MongoDBConnection do
376
376
end
377
377
end
378
378
379
- defp execute_action ( :error , _query , _opts , state ) do
379
+ defp send_command ( :error , _opts , state ) do
380
380
exception = Mongo.Error . exception ( "Test-case" )
381
381
{ :disconnect , exception , state }
382
382
end
0 commit comments