Last active
May 26, 2019 10:56
-
-
Save Linus-Albertus/67a1e9c3143208b3652a6f5a4f28180e to your computer and use it in GitHub Desktop.
[pmongo regex consult] Consult a mongodb database with pymongo #pymongo #mongodb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pymongo import MongoClient | |
client = MongoClient() | |
db = client.your_mongo_db | |
responses = db.your_mongodb_collection.find( { 'field_name': {'$regex' : "regular_expresion", "$options" : "i"} } ) | |
for response in responses: | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment