如何在ls2_df= ls_df[(ls_df.Manager == "David H") & (ls_df.Store == 4007)]
ls2_df['TimeStamp'] = pd.to_datetime(ls2_df.TimeStamp)
的{{1}}阶段进行regex
搜索?
pipeline
我已经尝试了几件事,而且我很确定正则表达式阶段应该包装在另一个运算符中,只是不确定哪个是哪个?
答案 0 :(得分:0)
对于Mongo 4.2及更高版本,您可以使用$regexMatch
db.collection.aggregate([
{
$lookup: {
from: "other",
let: {
name: "$name"
},
pipeline: [
{
$match: {
$expr: {
$regexMatch: {
input: "$name",
regex: "$$name",
options: "i"
}
}
}
}
],
as: "newDocument"
}
}
])