使用正则表达式的 cloudant nosql 数据库查询
cloudant nosql db query with regex
我有一个 cloudant nosql 数据库,其中包含一些这样的记录:
{
"role": "utente",
"nome": "Rocco",
"cognome": "Di Vitto",
"team": "sap pm-cs",
"company": "wrestling",
"appManager": "john Ford",
"teamLeader": "Rendy Orton, Colombo M.R."
}
我想用 $regex teamLeader 字段查询我的数据库,传递与 "Randy Orton" 或 "Colombo M.R." 匹配的单个字符串,但我无法找出匹配的正则表达式两个逗号分隔的字符串。我试过阅读 Erlang 查询结构,但没有找到解决方案。一些帮助会非常有用。提前致谢
在提供正则表达式时,您应该使用 $regex 运算符。你有没有尝试过这样的事情:
{
"selector": {
"teamLeader": {
"$regex": "(Colombo M.R.)|(Rendy Orton)"
}
}
}
我有一个 cloudant nosql 数据库,其中包含一些这样的记录:
{
"role": "utente",
"nome": "Rocco",
"cognome": "Di Vitto",
"team": "sap pm-cs",
"company": "wrestling",
"appManager": "john Ford",
"teamLeader": "Rendy Orton, Colombo M.R."
}
我想用 $regex teamLeader 字段查询我的数据库,传递与 "Randy Orton" 或 "Colombo M.R." 匹配的单个字符串,但我无法找出匹配的正则表达式两个逗号分隔的字符串。我试过阅读 Erlang 查询结构,但没有找到解决方案。一些帮助会非常有用。提前致谢
在提供正则表达式时,您应该使用 $regex 运算符。你有没有尝试过这样的事情:
{
"selector": {
"teamLeader": {
"$regex": "(Colombo M.R.)|(Rendy Orton)"
}
}
}