I have a document such as:
{'my_key': '2019-carbeureter'}
I want to search for '2019'
db.collection.find({'my_key': query_string } # isn't working with the following
query_string = "/2019/" # doesn't work
query_string = r"/2019/" # same thing
query_string = ".*2019.*" # doesn't work
This other SO question addresses it in native mongoDB, but how do I do this in Python using pymongo? How to query MongoDB with "like"?