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:
- 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.
- 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)?
- 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.
0 个评论
回答(1 个)
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
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!