如何处理RSQL的投影列表值中的空间 [英] How to handle space in projection list value of RSQL

查看:102
本文介绍了如何处理RSQL的投影列表值中的空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一种情况,我需要使用RSQL过滤数据. 我需要使用$projection=field_list=in=(FAMILY Id)来获取特定的列,但是由于"Family Id"中的列具有空格,因此将其抛出以下错误.

I have a scenario where I need filter data using RSQL. I need to get specific columns hence using $projection=field_list=in=(FAMILY Id) But as the column here "FAMILY Id" has a space , its throwing below error.

cz.jirutka.rsql.parser.ParseException: Encountered " <UNRESERVED_STR> "Id "" at line 1, column 23.

期待以下一项:

<OR> ...
")" ...

如果我在单引号中传递相同的内容,它将像$projection=field_list=in=('FAMILY Id')一样工作,但是还有其他方法可以处理相同的内容,因为我还有其他几种以相同的方式在单引号中包含相同内容的方案不起作用.

If I pass the same in single quotes it would work , like $projection=field_list=in=('FAMILY Id'), but is there any other way to handle the same , as i have few more scenarios in the similar way where putting the same in single quotes too does not work.

谢谢.

〜Shyam

推荐答案

参数可以是单个值,也可以是括号中的多个值 以逗号分隔.不包含任何保留字符的值 否则空白不能用引号引起来,其他引数必须包含在其中 单引号或双引号.

Argument can be a single value, or multiple values in parenthesis separated by comma. Value that doesn’t contain any reserved character or a white space can be unquoted, other arguments must be enclosed in single or double quotes.

field_list=in=(FAMILY Id)无效,因此您必须使用单引号双引号.我没有其他办法,我相信在所有情况下报价都足够.好吧,除了您的参数中有单引号和双引号之外– RSQL当前未指定任何转义字符.

field_list=in=(FAMILY Id) is invalid, so you must use single or double quotes. There’s no any other way, I believe that quoting is sufficient for all the cases. Well, except you have both single and double quotes inside an argument – RSQL currently doesn’t specify any escape character.

这篇关于如何处理RSQL的投影列表值中的空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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