Reputation: 589
Let's say I have a list of keywords and I want to match against MongoDB documents in which they all appear in the keys
field (that is, a AND clause).
How can I do that in Python?
I've tried:
keywords = ['a', 'b', 'c']
keywords_dict = {'keys' : keywords}
results = collection.find(keywords_dict)
But it seems to return no result.
I'm using Python3.5 with PyMongo.
Any hints?
Upvotes: 1
Views: 38