我对jongo有问题。
我的代码:
#for each value map in nested list comprehension
df1['new'] = [[d1.get(y, None) for y in x if y in d1] for x in df1['keywords']]
print (df1)
keywords \
0 [loans, mercedez, bugatti, a4]
1 [trump, usa, election, president]
2 [galaxy, 7s, canon, macbook]
3 [beiber, spiderman, marvels, ironmen]
new
0 [finance, mercedez, bugatti, audi]
1 [politics, politics]
2 [apple, dslr]
3 [music, entertainment, entertainment]
查询就像:
myCollection.find(query)
代码有效,直到在搜索中使用#号为止。数据可以包含#。 搜索#时发生异常:
{"CustomerId":{"$regex":"\\#1"}}
我想发现完全忽略文本中的所有#。 我该如何逃脱呢?