I am trying to query my mongo db for an element in python2.7 using
output = collection.find_one({ $and : [{'name' : data['name']},{'phone_1' : data['phone_1']}]})
when i try to run python script tell me
File "./test.py", line 113
output = collection.find_one({ $and : [{'name' : data['name']},{'phone_1' : data['phone_1']}]})
^
SyntaxError: invalid syntax
I checked the manual and version of mongo. I installed mongodb 2.0.6, so the syntax above should be fine. Did I miss something?
source
share