Data Transform
Partition by predicate API
Splits an array into [matching, rest] using a Mongo-style predicate, partitioning in a single pass. Answers 'How do I split records into pass/fail buckets?', 'How do I partition an array by a condition?'.
Price$0.01per request
MethodPOST
Route/v1/data-transform/partition
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
data-transformpartitionsplitpredicatearrayjsonwrangle
API URL
Integration docshttps://x402.hexl.dev/v1/data-transform/partitionExample request
{
"data": [
{
"n": 1
},
{
"n": 5
},
{
"n": 9
}
],
"where": {
"n": {
"$gt": 4
}
}
}Example response
{
"matching": [
{
"n": 5
},
{
"n": 9
}
],
"rest": [
{
"n": 1
}
]
}Input schema
{
"type": "object",
"required": [
"data",
"where"
],
"properties": {
"data": {
"type": "array",
"examples": [
[
{
"n": 1
},
{
"n": 5
},
{
"n": 9
}
]
]
},
"where": {
"type": "object",
"examples": [
{
"n": {
"$gt": 4
}
}
]
}
}
}Output schema
{
"type": "object",
"additionalProperties": true
}