I've solved the issue by including the param directConnection=true to my connection string.
?directConnection=true
So, the connection string is something like this:
mongodb://127.0.0.1:27017/mydb?directConnection=true
I get the tip from mongosh, which connected successfuly