Python modules for writing scripts with MongoDB

You have been tasked with creating a Python script that is suitable for extracting data from a mongodb data source. However the extract must be incremental and only include data added within the last week.

List the Python modules that could be used to achieve this task.

Hello @Alai_Yosief, Welcome to the MongoDB Developer Community forum!

I have some information for you about your questions. Hope you find it useful and explore further.

You access MongoDB data from a Python program using the PyMongo library.

You can extract MongoDB data by querying the database collection using the find method. See an example in the PyMongo tutorial Querying for More Than One Document.

To query only a set of data filtering based upon date/time see Range Queries.

So, the two modules you would use to perform the query are the pymongo and the datetime.

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.