i have been trying to query using .py file to mongoDB using pymongo.
So the problem now is that i want the user to input the searchField personally.
This is my code...
from pymongo import Connection
if __name__ == "__main__":
con = Connection()
db = con.fyptwitter
collection = db.fyp
userInputFirst = str(raw_input("Enter: "))
userInputSecond = str(raw_input("Enter 2nd: "))
strFirst = userInputFirst
stringTest = "/" + userInputSecond + "/i"
query = db.fyp.find({ userInputFirst : stringTest})
print query
for i in query:
print i
break
from my mongoConnection, it shows that the query is correct. But the problem is that it does not bring up any results.
Any reason why?