我需要使用MongoDb实现搜索+排序和过滤
QueryByExampleExecutor的方法似乎是我需要的方法
<S extends T> Page<S> findAll(Example<S> example, Pageable pageable);
但是在示例模型中,我需要同时组合AND和OR条件-像……
"parentUuid = ... AND (field1 like ... OR field2 like ... OR field3 like ...)"
以及另外一项要求-> $ field1,$ field2和$ field3将在运行时解析,因为数据结构不固定。
我该如何实施?
对于这种情况和更复杂的情况,好的解决方案是QueryDSL