問題描述
Mongo 客戶端出錯 (Error with Mongo Client)
When I try to connected to a Mongo server with the mongo client, I get the following warning:
Error while trying to show server startup warnings: no such cmd
It still gives me access and I can access the database. The issue is when I try accessing the DB from C#. That warning throws an exception, and the application terminates.
The mongod command used was
mongod ‑‑port 30000
No startup scripts as far as I can tell.
The mongo server is running on Debian, on another machine.
Update
The error thrown by .NET is
Unable to connect to server xxx.xxx.xxx.xx:30000: Command 'ping' failed: no such cmd (response: { "errmsg" : "no such cmd", "bad cmd" : { "ping" : 1 }, "ok" : 0.0 }).
參考解法
方法 1:
Solved. The server version was older than the client version.