This is a simple example of how to use java driver for mongoDB.
From http://www.mongodb.org/ :
MongoDB is an open-source document database, and the leading NoSQL database. Written in C++.
If you do not have any toolbox to manipulate databases, you have several options. You can use a SqlLite database as it is a simple file, or you could use a SQL server on your computer. I present here a simple approach with mongoDB.
To run this example, you need to install mongoDB on your computer. Then, download the last java driver (JAR file) your favorite directory.
The file is largely commented so you can follow each steps easily. This simple example is partly taken from the mongoDB website and adapted for Matlab. This prooves how to store various objects in a single tuple of a database, much more versatile than SQL as you can store any type of data, from string to flat to arrays etc.
Have fun !
Guillaume A. (2020). Use of MongoDB Java Driver (https://www.mathworks.com/matlabcentral/fileexchange/43171-use-of-mongodb-java-driver), MATLAB Central File Exchange. Retrieved .
Hi! how I connect MongoDB Atlas with Matlab?
For clarity, download this "mongo-java-driver-*.*.*.jar", NOT this "mongodb-driver-*.*.*.jar" where the * is just the version number.
how to use filters in methoh find() for matlab?
Is MATLAB Interface to MongoDB just compatible with Mongo Server version 3.0? Not the later release? I have MongoDB 3.2.9 and could not find any older version of it.
Warning for Blatant Self Promotion :
inspired by your submission I opened a repository on GitHub that also contains examples for query, aggregate and mapreduce: https://github.com/HanOostdijk/matlab_mongodb.git
For getting the data in MATLAB format jsonlab ( http://www.mathworks.com/matlabcentral/fileexchange/33381-jsonlab--a-toolbox-to-encode-decode-json-files-in-matlab-octave ) is also useful.
Could do with better documentation TBH. Professional code though.
%% Specify the connection details
myHost = '149.451.25.123:27017';
myUsername = 'dataviewer';
myPassword = 'BlahBlahBlackSheep';
myDb = 'myTableName';
%% Connect to MongoDB
m = Mongo([myHost '/' myDb]);
error('MongoSample:MongoSample', 'No connection');
Added some comments in file