3
我有一个实体文档与DocumentValue的Querydsl路径深度
@QueryEntity
@Document
public class Document{
private List<DocumentValue> documentValues;
}
DocumentValue可以列表也有DocumentValue列表
@QueryEntity
public class DocumentValue {
String value;
String name;
String id;
List<DocumentValue> documentValues;
}
我现在试图做类似
private QDocumentValue getDocumentValuePathByDepth(int depth){
ListPath path = QDocument.document.documentValues;
if (depth != null) {
for (int i = 0; i < depth; i++) {
path = path.documentValues.any();
}
}
}
有没有人知道它是否有可能在这个深度做eleMatch?
就像在深度documentValues应该满足两个条件
BR DC
的ListPath<QDocumentValue> query = getDocumentValuePathByDepth(5);
return query.fieldId.eq(documentFilter.getFieldId()).and(query.value.between(from, to));
一个要素
任何建议,我的实际问题? – DanDiesel
看到下面的答案 – DanDiesel
你没有在你的问题中提到elemMatch。也许更新也是这个问题? –