got error using mongo / java.net.ConnectException:
信息
此问题已关闭。 请重新打开它进行编辑或回答。
显示 更早的评论
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 个评论
回答(0 个)
此问题已关闭。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!