The wide ecosystem of Python modules enables you get to work fast and effectively integrate your systems. You can use the CData Python Connector for MongoDB and the SQLAlchemy toolkit to build MongoDB-connected Python applications and scripts.
This article details how to use SQLAlchemy to connect to MongoDB data to query, update, delete, and insert MongoDB data.
Connecting to MongoDB Data
Connecting to MongoDB data is similar to connecting to any other relational database. Create a connection string using the required connection properties. For this article, you will pass the connection string as a parameter to the create_engine function.
Set the Server, Database, User, and Password connection properties to connect to MongoDB. To access MongoDB collections as tables you can use automatic schema