It seems that the collection.crcommand_simple function calls the LibMongoC.collection_command_simple binding with a missing argument.
In lib/mongo/src/mongo/collection.cr:63:18
63 | if LibMongoC.collection_command_simple(self, command.to_bson, out reply, out error)
^------------------------
Error: wrong number of arguments for 'LibMongoC#collection_command_simple' (given 4, expected 5)
streams in pooled mode
Custom streams using a TCPSocket were not connecting to the db properly when in pooled mode, since polling is dedicated to a background thread unlike in single thread mode.
Done
Added the mongo preferences prefs as a third argument to satisfy the call.
Fixes socket connection when in pooled mode by adding a connected bool as a class variable and forcing connection when requesting the socket and connected is false.
Issue
It seems that the
collection.cr
command_simple
function calls theLibMongoC.collection_command_simple
binding with a missing argument.Custom streams using a
TCPSocket
were not connecting to the db properly when in pooled mode, since polling is dedicated to a background thread unlike in single thread mode.Done
prefs
as a third argument to satisfy the call.