got error using mongo / java.net.C​onnectExce​ption:

i used mongoDB from matlab. but i got error.
error log >>>
Error using mongo (line 388)
[Mongo Driver Error]:Timed out after 10000 ms while waiting to connect. Client view of cluster state is {type=UNKNOWN, servers=[{address=localhost:27017, type=UNKNOWN, state=CONNECTING,
exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.ConnectException: Connection refused (Connection refused)}}].
Error in mongoDB (line 5)
conn = mongo(server,port,dbname)
my code
server = "localhost";
port = 27017;
dbname = "AAA";
conn = mongo(server,port,dbname)
isopen(conn)
employee1.employee = 26;
employee1.department = 'Sales';
employee1.salary = 100000;
documents = employee1
collection = "jse";
n = insert(conn,collection,documents)
close(conn)

回答(0 个)

此问题已关闭。

提问:

2018-5-29

关闭:

2018-5-29

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by