Closed felipenoris closed 6 years ago
Aparently, the only way to check if a connection was successful is to try insert something in the database:
@testset "Mongo: bad host/port" begin client = MongoClient("bad-host-name", 9999) collection = MongoCollection(client, "foo", "bar") @test_throws ErrorException insert(collection, ("foo" => "bar")) end
Even a query will return a iterator without errors, but with no data.
There should be a way to check if the connection to the host was successful.
Aparently, the only way to check if a connection was successful is to try insert something in the database:
Even a query will return a iterator without errors, but with no data.
There should be a way to check if the connection to the host was successful.