JSON array project
json-array-project · version 1.0.0 · JSON & JSONL · free, no key needed
Select specific keys from each object in a JSON array.
Use when you need to: json array project · select keys from json array · pick json array fields.
Supported
- json array project
- select keys from json array
- pick json array fields
Not supported
- deep projection
- rename keys
Behavior
- Outputs a new array where each object only contains the specified keys.
- Keys that do not exist in an object are simply omitted from the result for that object.
- Output keys follow the order specified in the keys array.
Input
array(array of object, required): max items 10000keys(array of string, required): min items 1; max items 32; each min length 1
Output
result(array of object, required)count(integer, required)
Limits
- max array items: 10000
- max output items: 10000
- max keys: 32
Example
Request input:
{
"array": [
{
"a": 1,
"b": 2,
"c": 3
},
{
"a": 4,
"c": 6
}
],
"keys": [
"a",
"c"
]
}
Response:
{
"result": {
"result": [
{
"a": 1,
"c": 3
},
{
"a": 4,
"c": 6
}
],
"count": 2
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "json-array-project",
"version": "1.0.0",
"input": {
"array": [
{
"a": 1,
"b": 2,
"c": 3
},
{
"a": 4,
"c": 6
}
],
"keys": [
"a",
"c"
]
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/json-array-project/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"array":[{"a":1,"b":2,"c":3},{"a":4,"c":6}],"keys":["a","c"]}'
The machine-readable contract is at /v1/tools/json-array-project/versions/1.0.0.
CLI
node cli.mjs run json-array-project 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- JSON array drop keys: Remove specific keys from each object in a JSON array.
- JSON array rename keys: Rename specific keys in each object in a JSON array.
- JSON pick pointers: Pick cloned JSON values at explicit RFC 6901 pointers into a null-prototype map.
- JSON array anti join: Anti join two JSON arrays of objects on exact keys.
- JSON array filter equals: Filter JSON array objects where a key equals a specific value.
- JSON array group by: Group an array of JSON objects by exact keys.