How to use mongodb as database in qt
-
Hi Qt Community,
I’m looking for guidance on integrating MongoDB with a Qt application. I’m familiar with Qt for building GUI and backend components, but I haven’t found clear documentation or examples on connecting to a MongoDB database from Qt.
Specifically, I’d like to know:
What is the recommended approach for connecting to MongoDB in a Qt application? (Direct C++ driver, Qt plugin, or via REST/HTTP API?)
Are there any official or community-supported Qt modules for MongoDB?
Best practices for performing CRUD operations and handling connections asynchronously in Qt.
If anyone has sample code, tutorials, or pointers to resources, that would be extremely helpful.
Thanks in advance for your guidance!
-
Hi Qt Community,
I’m looking for guidance on integrating MongoDB with a Qt application. I’m familiar with Qt for building GUI and backend components, but I haven’t found clear documentation or examples on connecting to a MongoDB database from Qt.
Specifically, I’d like to know:
What is the recommended approach for connecting to MongoDB in a Qt application? (Direct C++ driver, Qt plugin, or via REST/HTTP API?)
Are there any official or community-supported Qt modules for MongoDB?
Best practices for performing CRUD operations and handling connections asynchronously in Qt.
If anyone has sample code, tutorials, or pointers to resources, that would be extremely helpful.
Thanks in advance for your guidance!
@sumit.chatterjee As far as I know there is no official Qt driver for MongoDB. But you can use the C++ official C++ driver. REST/HTTP is better suited for client/server architectures with server located somewhere else.
-
There is no Qt api to access a mongoDb - you have to do it by yourself.
Since it's a no-sql database you won't be able to use QtSql module here.