Closed potnoddle closed 3 years ago
Might be something wrong with the connection. By the driver design, it is lazy, so you see problems later, e.g. on Get-MdbcData
.
Let's try to get some info right after connecting, e.g. list database names, can you try it?
Connect-Mdbc -ConnectionString $connStr -DatabaseName *
I get the same (poor) error with the below script when MongoDB is not running.
Connect-Mdbc . test test
Get-MdbcData @{ name = 'bar' }
I think your case is similar (including wrong connection string).
v6.5.10 produces better errors, e.g. in my case:
Get-MdbcData : A timeout occurred after 30000ms selecting a server using CompositeServerSelector{ Selectors =
MongoDB.Driver.MongoClient+AreSessionsSupportedServerSelector, LatencyLimitingServerSelector{ AllowedLatencyRange = 00:00:00.0150000 } }. Client view of cluster
state is { ClusterId : "1", Type : "Unknown", State : "Disconnected", Servers : [{ ServerId: "{ ClusterId : 1, EndPoint : "Unspecified/localhost:27017" }",
EndPoint: "Unspecified/localhost:27017", ReasonChanged: "Heartbeat", State: "Disconnected", ServerVersion: , TopologyVersion: , Type: "Unknown",
HeartbeatException: "MongoDB.Driver.MongoConnectionException: An exception occurred while opening a connection to the server. ...
I close the issue. Feel free to reopen with some more details.
I've managed to successfully connect to a mongodb.net db and collection. However, whenever try one of the commands like Get-MdbcData there's a long timeout followed by the following error.
works untill
$doc = Get-MdbcData @{ name = '$searchStr'} -Collection $collection
I'm really lost as what the issue is, I've tried adding a verbose to the command without any luck.