Pymongo-text search-list of phrases
问题 I have a dictionary of the following structure: keywords={topic_1:{category_1:['\"phrase_1\"','\"phrase_2\"'], catgeory_2:[''\"phrase_1\"','\"phrase_2\"']}, topic_2:{category_1:['\"phrase_1\"','\"phrase_2\"','\"phrase_3\"']}} I have a bunch of documents in mongodb on which I want tag a [category,topic] tag as long as it matches any one of the phrases in the [topic][category].However I need to iterate phrase by phrase as follows( Pymongo) : for topic in keywords: for category in keywords[topic