v2.16.6
What's Changed
- feat(doc): add
Query Service
doc by @Ahoo-Wang in #536 - chore(deps): update dependency vitepress to v1.0.0-rc.44 by @renovate in #537
QueryDsl
通过 QueryDsl
,您可以轻松构建复杂的查询条件,例如:
pagedQuery {
pagination {
index(1)
size(10)
}
sort {
"field1".asc()
}
condition {
"field1" eq "value1"
"field2" ne "value2"
"filed3" gt 1
"field4" lt 1
"field5" gte 1
"field6" lte 1
"field7" like "value7"
"field8" isIn listOf("value8")
"field9" notIn listOf("value9")
"field10" between (1 to 2)
"field11" all listOf("value11")
"field12" startsWith "value12"
"field13" elemMatch {
"field14" eq "value14"
}
"field15".isNull()
"field16".notNull()
and {
"field3" eq "value3"
"field4" eq "value4"
}
or {
"field3" eq "value3"
"field4" eq "value4"
}
}
}
OpenAPI
以下是一个示例 curl
命令,用于执行查询:
curl -X 'POST' \
'http://localhost:8080/execution_failed/snapshot/pagination' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"sort": [
{
"field": "_id",
"direction": "DESC"
}
],
"pagination": {
"index": 1,
"size": 10
},
"condition": {
"field": "",
"operator": "AND",
"value": "",
"children": [
{
"field": "state.recoverable",
"operator": "NE",
"value": "UNRECOVERABLE",
"children": []
},
{
"field": "state.status",
"operator": "NE",
"value": "SUCCEEDED",
"children": []
},
{
"field": "state.isBelowRetryThreshold",
"operator": "EQ",
"value": false,
"children": []
}
]
}
}'
TypeScript
在 TypeScript 中,您可以使用 Conditions
类来构建复杂的查询条件,例如:
Conditions.and(
[
Conditions.ne(ExecutionFailedFields.RECOVERABLE, RecoverableType.UNRECOVERABLE),
Conditions.ne(ExecutionFailedFields.STATUS, ExecutionFailedStatus.SUCCEEDED),
Conditions.eq(ExecutionFailedFields.IS_BELOW_RETRY_THRESHOLD, false)
]
)
Full Changelog: v2.16.5...v2.16.6