Questions concerning the MongoDB connector for Matlab

2 次查看(过去 30 天)
Hello,
I am currently testing out the Database Toolbox Interface for MongoDB by MathWorks Computational Finance Team with the mongo function (https://ch.mathworks.com/help/releases/R2020b/database/ug/mongo.html?searchHighlight=mongo&s_tid=doc_srchtitle).
However, I am struggling to find answers to the following, maybe the community can help or someone has already dealt with these issues or found a solution:
  1. Does the interface support ISODate or any datetime query? If so, how should one proceed? The same query would work on MongoDB Compass but the Matlab interface throws me an error. I have seen suggestions on storing datetime objects in another type (integer or float) and then querying on that but I would like to avoid this.
  2. I am seeing people struggling to connect with Atlas, the cloud-hosted database of MongoDB. Is this supported by the interface or has anyone managed to succesfully do this (and with which MongoDB version)?
  3. From my empirical tests, I'm finding that querying is extremly slow compared to Python or Compass. Has anyone else noticed this as well? I originally did the tests on MongoDB 5.0 and downgraded to 4.0 but the issue still persists.
I am using Matlab R2020b and I have done my tests on MongoDB 5.0 and 4.0. Any help would be greatly appreciated.
Thank you.

回答(1 个)

Jason Steiner
Jason Steiner 2023-3-13
The mongo read/write speeds in Matlab are slower than Python. If you upgrade to r2022A and get the updated mongo connecter (mongoc) is greatly improves the query time.
From my own benchmarking today the comparison is
720 Documents on the same machine connecting to the same machine, sending the same data.
Matlab --> 6 seconds
Python --> 0.6 seconds

类别

Help CenterFile Exchange 中查找有关 Database Toolbox 的更多信息

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by