Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
同事,如何将投影算子![expr]和过滤器结合在一起?[ boolean ]。例如我有一些实体:
![expr]
?[ boolean ]
class User { int age; String name; }
我想从用户列表中选择 30 岁以上的用户名。
独立投影如下所示:
#myArray.![name]
独立过滤如下所示:
#myArray.?[age > 30]
那么如何组合呢?先感谢您!
(#myArray.?[age > 30]).![name]
即对选择的结果进行投影。