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)

Risposte (0)

Questa domanda è chiusa.

Richiesto:

il 29 Mag 2018

Chiuso:

il 29 Mag 2018

Community Treasure Hunt

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

Start Hunting!

Translated by