how to access mongoDB from Matlab
4 ビュー (過去 30 日間)
古いコメントを表示
I'm trying to access mongoDB from Matlab through Java driver, but it seems Matlab could not find MongoClient class.
>> javaaddpath('mongodb-driver-3.2.2.jar');
>> import com.mongodb.*;
>> mc = MongoClient(server, port);
Undefined function or variable 'MongoClient'.
>> import com.mongodb.MongoClient;
Error using import Import argument 'com.mongodb.MongoClient' cannot be found or cannot be imported.
0 件のコメント
採用された回答
Neil Caithness
2017 年 5 月 18 日
Using version 3.4.2 of the Java driver I have success with this:
MongoDB Atlas instances will tell you the properly formatted URI.
uristr = 'mongodb://<USERNAME>:<PASSWORD>@cluster0-shard-00-00-...';
uri = MongoClientURI( uristr );
mc = MongoClient( uri );
db = mc.getDatabase( database );
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Database Toolbox についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!