File Exchange

image thumbnail

Database Toolbox Interface for MongoDB

Explore and manage collections of documents in MongoDB®


Updated 18 Mar 2020

MongoDB enables you to store, query, and retrieve unstructured and structured data. In contrast to relational databases, which store tables of data organized by rows, MongoDB stores data as collections of documents that provide a richer structure for managing data that does not fit well into a table format. This storage model is widely used for storing social, web, and sensor data.
Connect to MongoDB using the Database Toolbox interface for MongoDB. Access documents and import data stored in documents into the MATLAB® workspace for analysis. Run MongoDB queries against a collection of documents in MongoDB. Export MATLAB tables, structures, and objects into MongoDB.

This interface is functional for R2017b and beyond.

Comments and Ratings (13)

igor laptev

David Barry

Does this interface support a cloud hosted database on MongoDB Atlas version 4.0.12? I can connect to a local database fine but am struggling with Atlas. If it is support, please could you share some example connection code? I'm trying the following:

conn = mongo('', 27017, 'databaseNameGoesHere', ...
'UserName', 'blah', ...
'Password', 'blah');

Hugh Zhang

How can I retrieve documents from MongoDB collection with timestamp query?

how do I establish a matlab connection to MongoDB with SSL enabled ?

How can I connect to the Mongo Atlas database using the URI string?

How do I make this add on work for compiled stand alone files? It works great in the editor. I believe I have to add the javapath but am not sure where the files are that I have to include when compiling.


How can i download this file without opening MATLAB?

I am having problems getting this to run after downloading. These other Mathworks links may be helpful to others, but I'm less familiar with the libselinux install needed. Any tips are appreciated.

Thanks, trying it.
Are there more examples with real directions and passwords?

MATLAB Release Compatibility
Created with R2017b
Compatible with R2017b to R2020a
Platform Compatibility
Windows macOS Linux