如何在Opa中“点赞"查询? [英] How to do 'like' queries in Opa?

查看:96
本文介绍了如何在Opa中“点赞"查询?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的情况很简单.我需要对一个字段进行包含/类似搜索.根据此文档,您可以进行正则表达式来实现此目的:

My case is very simple. I need to do a contains/like search over a field. Based on this documentation you can do a regex to achieve this:

items/item[name =~ ".*{value}.*"; skip pagination.startOn; limit pagination.numberOf; order +modifiedOn]

但是我在=~运算符上遇到编译错误.检查编译错误的输出,我看到这是我拥有的选项

But I'm getting a compilation error at the =~operator. Checking the output of the compilation error I saw that this are the options that I've

Hint: expected "!=" or "<" or "<=" or "==" or ">" or ">=" or "[" or "as" or "_" or "else" or "then" or "if" or "do" or "type" or "with" or "match" or "exists" or "in" or ' ' or ' ' or <spacing>

其中哪些选项允许我执行正则表达式查询?

Which of those options will allow me to do the regex query?

我正在使用此版本的opa(暂时无法使用)

I'm using this version of opa (I'm stuck with it for the moment)

OPA version 0.9.2
(c) 2007-2012 MLstate, All Rights Reserved.
Build: 1815-(fe5cc09)

推荐答案

对正则表达式的支持是Opa的新增功能,而且您的编译器已经过时.请注意,Mongo $regex 运算符可能会严重影响性能,因为它如何使用索引.参见讨论关于Opa中的文本搜索.

Regular expression support is quite new addition to the Opa, and you have outdated compiler. Note, that Mongo $regex operator may impact performance significantly because of how it uses indexes. See the discussion on text search in Opa.

这篇关于如何在Opa中“点赞"查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆