How to do 'like' queries in Opa?

主宰稳场 提交于 2019-12-25 03:34:36

问题


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?

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)

回答1:


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.



来源:https://stackoverflow.com/questions/30855810/how-to-do-like-queries-in-opa

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!